History

Fix and improve Chai scraper

Thibaut Courouble committed 10 years ago

Commit fa100bf1 parent 13bd8a08 files · +6 −12Browse files

Unified · Split

8 files
  1. assets/javascripts/views/pages/javascript.coffee +0 −1
  2. assets/javascripts/views/pages/simple.coffee +1 −0
  3. assets/stylesheets/application-dark.css.scss +0 −1
  4. assets/stylesheets/application.css.scss +0 −1
  5. assets/stylesheets/pages/_chai.scss +0 −5
  6. assets/stylesheets/pages/_simple.scss +1 −0
  7. lib/docs/filters/chai/clean_html.rb +2 −2
  8. lib/docs/filters/chai/entries.rb +2 −2
assets/javascripts/views/pages/javascript.coffee+0−1
@@ -15,7 +15,6 @@ class app.views.JavascriptWithMarkupCheckPage extends app.views.BasePage · 14 unmodified lines
1515 @highlightCode el, language
1616 return
1717
18−app.views.ChaiPage =
1918 app.views.GruntPage =
2019 app.views.MochaPage =
2120 app.views.JavascriptPage
assets/javascripts/views/pages/simple.coffee+1−0
@@ -9,6 +9,7 @@ class app.views.SimplePage extends app.views.BasePage · 8 unmodified lines
99 app.views.AngularPage =
1010 app.views.AngularjsPage =
1111 app.views.CakephpPage =
12+app.views.ChaiPage =
1213 app.views.ElixirPage =
1314 app.views.EmberPage =
1415 app.views.ExpressPage =
assets/stylesheets/application-dark.css.scss+0−1
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 'pages/bower',
3838 'pages/c',
3939 'pages/cakephp',
40− 'pages/chai',
4140 'pages/clojure',
4241 'pages/coffeescript',
4342 'pages/d3',
assets/stylesheets/application.css.scss+0−1
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 'pages/bower',
3838 'pages/c',
3939 'pages/cakephp',
40− 'pages/chai',
4140 'pages/clojure',
4241 'pages/coffeescript',
4342 'pages/d3',
assets/stylesheets/pages/_chai.scss+0−5
@@ -1,5 +0,0 @@
1−._chai {
2− @extend %simple;
3−
4− li.tag span { margin-right: 5px; }
5−}
assets/stylesheets/pages/_simple.scss+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 }
1818
1919 ._apache_pig,
20+._chai,
2021 ._cordova,
2122 ._gnu,
2223 ._grunt,
lib/docs/filters/chai/clean_html.rb+2−2
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
22 class Chai
33 class CleanHtmlFilter < Filter
44 def call
5− @doc = at_css('.documentation .rendered')
5+ @doc = at_css('.documentation .rendered') if at_css('.documentation .rendered')
66
77 if root_page?
88 at_css('h1').content = 'Chai Assertion Library'
@@ -12,9 +12,9 @@ module Docs · 3 unmodified lines
1212 node.before(node.children).remove
1313 end
1414
15− # Remove code highlighting
1615 css('pre').each do |node|
1716 node.content = node.content
17+ node['data-language'] = 'javascript'
1818 end
1919
2020 doc
lib/docs/filters/chai/entries.rb+2−2
@@ -6,12 +6,12 @@ module Docs · 5 unmodified lines
66 end
77
88 def get_type
9− subpath.start_with?('/guide') ? 'Guides' : nil
9+ subpath.start_with?('/guide') ? 'Guides' : name
1010 end
1111
1212 def additional_entries
1313 css('.antiscroll-inner a').each_with_object [] do |node, entries|
14− id = node['href'].remove('#') + '-section'
14+ id = node['href'].remove('#')
1515 node.content.strip.split(' / ').uniq { |name| name.downcase }.each do |name|
1616 entries << [name, id, self.name]
1717 end