Browse Source

Update Kotlin documentation (1.0.4)

Thibaut Courouble 9 years ago
parent
commit
5d36458c46
2 changed files with 4 additions and 2 deletions
  1. 3 1
      lib/docs/filters/kotlin/clean_html.rb
  2. 1 1
      lib/docs/scrapers/kotlin.rb

+ 3 - 1
lib/docs/filters/kotlin/clean_html.rb

@@ -15,7 +15,9 @@ module Docs
         end
 
         css('pre').each do |node|
-          node['data-language'] = node.at_css('code')['class'][/lang_(\w+)/, 1] if node.at_css('code')
+          node['data-language'] = 'kotlin' if node.at_css('code[data-lang="text/x-kotlin"]')
+          node['data-language'] = 'xml' if node.at_css('code[data-lang="application/xml"]')
+          node['data-language'] = 'javascript' if node.at_css('code[data-lang="text/javascript"]')
           node.content = node.content
         end
       end

+ 1 - 1
lib/docs/scrapers/kotlin.rb

@@ -1,7 +1,7 @@
 module Docs
   class Kotlin < UrlScraper
     self.type = 'kotlin'
-    self.release = '1.0.3'
+    self.release = '1.0.4'
     self.base_url = 'https://kotlinlang.org/'
     self.root_path = 'api/latest/jvm/stdlib/index.html'
     self.links = {