History

Update Chef documentation (12.9, 11.18)

Thibaut Courouble committed 10 years ago

Commit 265f1621 parent 6239ead6 files · +8 −40Browse files

Unified · Split

6 files
  1. assets/javascripts/views/pages/simple.coffee +1 −0
  2. assets/javascripts/views/pages/sphinx_simple.coffee +0 −7
  3. lib/docs/filters/chef/clean_html.rb +2 −1
  4. lib/docs/filters/opentsdb/clean_html.rb +1 −0
  5. lib/docs/scrapers/chef.rb +4 −4
  6. lib/docs/scrapers/chefclient.rb +0 −28
assets/javascripts/views/pages/simple.coffee+1−0
@@ -18,6 +18,7 @@ app.views.PostgresPage = · 17 unmodified lines
18app.views.RamdaPage =18app.views.RamdaPage =
19app.views.ReactPage =19app.views.ReactPage =
20app.views.RethinkdbPage =20app.views.RethinkdbPage =
21app.views.SphinxSimplePage =
21app.views.TensorflowPage =22app.views.TensorflowPage =
22app.views.TypescriptPage =23app.views.TypescriptPage =
23app.views.UnderscorePage =24app.views.UnderscorePage =
assets/javascripts/views/pages/sphinx_simple.coffee+0−7
@@ -1,7 +0,0 @@
1#= require views/pages/base
2
3class app.views.SphinxSimplePage extends app.views.BasePage
4 prepare: ->
5 @highlightCode @findAll('pre.highlight-ruby'), 'ruby'
6 @highlightCode @findAll('pre.highlight-javascript'), 'javascript'
7 return
lib/docs/filters/chef/clean_html.rb+2−1
@@ -24,9 +24,10 @@ module Docs · 23 unmodified lines
24 node.remove_attribute('border')24 node.remove_attribute('border')
25 end25 end
26 26
27 css('div[class^="highlight-"]').each do |node|27 css('div[class*="highlight-"]').each do |node|
28 node.content = node.content.strip28 node.content = node.content.strip
29 node.name = 'pre'29 node.name = 'pre'
30 node['data-language'] = node['class'][/highlight\-(\w+)/, 1]
30 end31 end
31 32
32 doc33 doc
lib/docs/filters/opentsdb/clean_html.rb+1−0
@@ -14,6 +14,7 @@ module Docs · 13 unmodified lines
14 end14 end
15 15
16 css('div[class*=highlight] .highlight pre').each do |node|16 css('div[class*=highlight] .highlight pre').each do |node|
17 node['data-language'] = node.parent.parent['class'][/highlight\-(\w+)/, 1]
17 node.parent.parent.before(node)18 node.parent.parent.before(node)
18 node.content = node.content.gsub(' ', ' ')19 node.content = node.content.gsub(' ', ' ')
19 end20 end
lib/docs/scrapers/chef.rb+4−4
@@ -24,10 +24,10 @@ module Docs · 23 unmodified lines
24 HTML24 HTML
25 25
26 version '12' do26 version '12' do
27 self.release = '12.7'27 self.release = '12.9'
28 28
29 options[:client_path] = client_path = '12-7'29 options[:client_path] = client_path = '12-9'
30 options[:server_path] = server_path = 'server_12-4'30 options[:server_path] = server_path = 'server_12-5'
31 31
32 self.root_path = "#{client_path}/chef_overview.html"32 self.root_path = "#{client_path}/chef_overview.html"
33 self.initial_paths = ["#{server_path}/server_components.html"]33 self.initial_paths = ["#{server_path}/server_components.html"]
@@ -39,7 +39,7 @@ module Docs · 5 unmodified lines
39 self.release = '11.18'39 self.release = '11.18'
40 40
41 options[:client_path] = client_path = '11-18'41 options[:client_path] = client_path = '11-18'
42 options[:server_path] = server_path = 'server_12-4'42 options[:server_path] = server_path = 'server_12-5'
43 43
44 self.root_path = "#{client_path}/chef_overview.html"44 self.root_path = "#{client_path}/chef_overview.html"
45 self.initial_paths = ["#{server_path}/server_components.html"]45 self.initial_paths = ["#{server_path}/server_components.html"]
lib/docs/scrapers/chefclient.rb+0−28
@@ -1,28 +0,0 @@
1module Docs
2 class Chefclient < UrlScraper
3 self.name = 'Chef Client'
4 self.slug = 'chefclient'
5 self.type = 'chefclient'
6 self.version = '12.5'
7 self.base_url = "https://docs.chef.io/release/#{version.sub '.', '-'}/"
8 self.links = {
9 home: 'https://www.chef.io/',
10 docs: 'https://docs.chef.io/'
11 }
12
13 html_filters.push 'chefclient/entries', 'chefclient/clean_html'
14
15 options[:fix_urls] = ->(url) do
16 url.remove! %r{/release/[0-9\-+]/}
17 url
18 end
19
20 options[:skip_patterns] = [/_images\//]
21 options[:trailing_slash] = false
22
23 options[:attribution] = <<-HTML
24 &copy; 2015 Chef Software, Inc.<br>
25 Creative Commons Attribution 3.0 Unported License.
26 HTML
27 end
28end