Pārlūkot izejas kodu

Update Chef documentation (12.9, 11.18)

Thibaut Courouble 9 gadi atpakaļ
vecāks
revīzija
265f162aec

+ 1 - 0
assets/javascripts/views/pages/simple.coffee

@@ -18,6 +18,7 @@ app.views.PostgresPage =
 app.views.RamdaPage =
 app.views.ReactPage =
 app.views.RethinkdbPage =
+app.views.SphinxSimplePage =
 app.views.TensorflowPage =
 app.views.TypescriptPage =
 app.views.UnderscorePage =

+ 0 - 7
assets/javascripts/views/pages/sphinx_simple.coffee

@@ -1,7 +0,0 @@
-#= require views/pages/base
-
-class app.views.SphinxSimplePage extends app.views.BasePage
-  prepare: ->
-    @highlightCode @findAll('pre.highlight-ruby'), 'ruby'
-    @highlightCode @findAll('pre.highlight-javascript'), 'javascript'
-    return

+ 2 - 1
lib/docs/filters/chef/clean_html.rb

@@ -24,9 +24,10 @@ module Docs
           node.remove_attribute('border')
         end
 
-        css('div[class^="highlight-"]').each do |node|
+        css('div[class*="highlight-"]').each do |node|
           node.content = node.content.strip
           node.name = 'pre'
+          node['data-language'] = node['class'][/highlight\-(\w+)/, 1]
         end
 
         doc

+ 1 - 0
lib/docs/filters/opentsdb/clean_html.rb

@@ -14,6 +14,7 @@ module Docs
         end
 
         css('div[class*=highlight] .highlight pre').each do |node|
+          node['data-language'] = node.parent.parent['class'][/highlight\-(\w+)/, 1]
           node.parent.parent.before(node)
           node.content = node.content.gsub('    ', '  ')
         end

+ 4 - 4
lib/docs/scrapers/chef.rb

@@ -24,10 +24,10 @@ module Docs
     HTML
 
     version '12' do
-      self.release = '12.7'
+      self.release = '12.9'
 
-      options[:client_path] = client_path = '12-7'
-      options[:server_path] = server_path = 'server_12-4'
+      options[:client_path] = client_path = '12-9'
+      options[:server_path] = server_path = 'server_12-5'
 
       self.root_path = "#{client_path}/chef_overview.html"
       self.initial_paths = ["#{server_path}/server_components.html"]
@@ -39,7 +39,7 @@ module Docs
       self.release = '11.18'
 
       options[:client_path] = client_path = '11-18'
-      options[:server_path] = server_path = 'server_12-4'
+      options[:server_path] = server_path = 'server_12-5'
 
       self.root_path = "#{client_path}/chef_overview.html"
       self.initial_paths = ["#{server_path}/server_components.html"]

+ 0 - 28
lib/docs/scrapers/chefclient.rb

@@ -1,28 +0,0 @@
-module Docs
-  class Chefclient < UrlScraper
-    self.name = 'Chef Client'
-    self.slug = 'chefclient'
-    self.type = 'chefclient'
-    self.version = '12.5'
-    self.base_url = "https://docs.chef.io/release/#{version.sub '.', '-'}/"
-    self.links = {
-      home: 'https://www.chef.io/',
-      docs: 'https://docs.chef.io/'
-    }
-
-    html_filters.push 'chefclient/entries', 'chefclient/clean_html'
-
-    options[:fix_urls] = ->(url) do
-      url.remove! %r{/release/[0-9\-+]/}
-      url
-    end
-
-    options[:skip_patterns]  = [/_images\//]
-    options[:trailing_slash] = false
-
-    options[:attribution] = <<-HTML
-      &copy; 2015 Chef Software, Inc.<br>
-      Creative Commons Attribution 3.0 Unported License.
-    HTML
-  end
-end