Update lodash documentation (4.16.2, 3.10.1, 2.4.2)

pull/501/head
Thibaut Courouble 8 years ago
parent 2acc13793c
commit 41d648144c

@ -163,6 +163,13 @@
} }
} }
._heading-links {
float: right;
font-weight: normal;
> a + a { margin-left: .25rem; }
}
// //
// Table of contents // Table of contents
// //

@ -90,6 +90,7 @@
margin: 2em 0 1em; margin: 2em 0 1em;
padding-left: .5em; padding-left: .5em;
padding-right: .5em; padding-right: .5em;
overflow: hidden;
font-size: inherit; font-size: inherit;
color: $boxHeaderColor; color: $boxHeaderColor;
border: 1px solid $boxBorder; border: 1px solid $boxBorder;

@ -2,21 +2,26 @@ module Docs
class Lodash class Lodash
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
@doc = at_css('h1+div+div') @doc = at_css('.doc-container')
css('h3 + p', 'hr').remove css('> div', '> div > div', '.highlight').each do |node|
node.before(node.children).remove
css('h2 a:contains("#")', 'h3 a:contains("#")').remove end
# Remove <code> inside headings # Remove <code> inside headings
css('h2', 'h3').each do |node| css('h2', 'h3').each do |node|
node.content = node.content node.content = node.content
end end
css('h3 + p > a:first-child').each do |node|
node.parent.previous_element << %(<div class="_heading-links">#{node.parent.inner_html}</div>)
node.parent.remove
end
# Remove code highlighting # Remove code highlighting
css('pre').each do |node| css('pre').each do |node|
node.inner_html = node.inner_html.gsub('<br>', "\n").gsub('&nbsp;', ' ') node.inner_html = node.inner_html.gsub('</div>', "</div>\n").gsub('&nbsp;', ' ')
node.content = node.content node.content = node.content.strip
node['data-language'] = 'javascript' node['data-language'] = 'javascript'
end end

@ -9,7 +9,7 @@ module Docs
heading.parent.css('a').each do |link| heading.parent.css('a').each do |link|
name = link.content name = link.content
name = name.remove(/\u{279C}.*/) name.remove! %r{\s.*}
entries << [name, link['href'].remove('#'), type] entries << [name, link['href'].remove('#'), type]
end end
end end

@ -19,13 +19,18 @@ module Docs
HTML HTML
version '4' do version '4' do
self.release = '4.15.0' self.release = '4.16.2'
self.base_url = 'https://lodash.com/docs' self.base_url = "https://lodash.com/docs/#{release}"
end end
version '3' do version '3' do
self.release = '3.10.0' self.release = '3.10.1'
self.base_url = 'https://lodash.com/docs' # OUT-OF-DATE self.base_url = "https://lodash.com/docs/#{release}"
end
version '2' do
self.release = '2.4.2'
self.base_url = "https://lodash.com/docs/#{release}"
end end
end end
end end

Loading…
Cancel
Save