Fix and improve Chai scraper

pull/427/merge
Thibaut Courouble 9 years ago
parent 13bd8a07b0
commit fa100bf535

@ -15,7 +15,6 @@ class app.views.JavascriptWithMarkupCheckPage extends app.views.BasePage
@highlightCode el, language
return
app.views.ChaiPage =
app.views.GruntPage =
app.views.MochaPage =
app.views.JavascriptPage

@ -9,6 +9,7 @@ class app.views.SimplePage extends app.views.BasePage
app.views.AngularPage =
app.views.AngularjsPage =
app.views.CakephpPage =
app.views.ChaiPage =
app.views.ElixirPage =
app.views.EmberPage =
app.views.ExpressPage =

@ -37,7 +37,6 @@
'pages/bower',
'pages/c',
'pages/cakephp',
'pages/chai',
'pages/clojure',
'pages/coffeescript',
'pages/d3',

@ -37,7 +37,6 @@
'pages/bower',
'pages/c',
'pages/cakephp',
'pages/chai',
'pages/clojure',
'pages/coffeescript',
'pages/d3',

@ -1,5 +0,0 @@
._chai {
@extend %simple;
li.tag span { margin-right: 5px; }
}

@ -17,6 +17,7 @@
}
._apache_pig,
._chai,
._cordova,
._gnu,
._grunt,

@ -2,7 +2,7 @@ module Docs
class Chai
class CleanHtmlFilter < Filter
def call
@doc = at_css('.documentation .rendered')
@doc = at_css('.documentation .rendered') if at_css('.documentation .rendered')
if root_page?
at_css('h1').content = 'Chai Assertion Library'
@ -12,9 +12,9 @@ module Docs
node.before(node.children).remove
end
# Remove code highlighting
css('pre').each do |node|
node.content = node.content
node['data-language'] = 'javascript'
end
doc

@ -6,12 +6,12 @@ module Docs
end
def get_type
subpath.start_with?('/guide') ? 'Guides' : nil
subpath.start_with?('/guide') ? 'Guides' : name
end
def additional_entries
css('.antiscroll-inner a').each_with_object [] do |node, entries|
id = node['href'].remove('#') + '-section'
id = node['href'].remove('#')
node.content.strip.split(' / ').uniq { |name| name.downcase }.each do |name|
entries << [name, id, self.name]
end

Loading…
Cancel
Save