Update and improve lodash documentation (3.2.0)

pull/168/head
Thibaut 10 years ago
parent e34e383fbf
commit b6c72c85e9

@ -2,6 +2,8 @@ module Docs
class Lodash
class CleanHtmlFilter < Filter
def call
@doc = at_css('h1+div+div')
css('h3 + p', 'hr').remove
# Set id attributes on <h3> instead of an empty <a>

@ -4,20 +4,13 @@ module Docs
def additional_entries
entries = []
css('h2').each do |node|
type = node.content.split.first
type.remove! %r{\W} # remove quotation marks
css('.toc-container h2').each do |heading|
type = heading.content.split.first
node.parent.css('h3').each do |heading|
name = heading.content
name.sub! %r{\(.+?\)}, '()'
entries << [name, heading['id'], type]
if h4 = heading.parent.at_css('h4') and h4.content.strip == 'Aliases'
h4.next_element.content.split(',').each do |n|
entries << ["#{n.strip}()", heading['id'], type]
end
end
heading.parent.css('a').each do |link|
name = link.content
name = name.remove(/\u{2192}.*/)
entries << [name, link['href'].remove('#'), type]
end
end

@ -1,15 +1,14 @@
module Docs
class Lodash < UrlScraper
self.name = 'Lo-Dash'
self.name = 'lodash'
self.slug = 'lodash'
self.type = 'lodash'
self.version = '3.1.0'
self.version = '3.2.0'
self.base_url = 'https://lodash.com/docs'
html_filters.push 'lodash/clean_html', 'lodash/entries', 'title'
html_filters.push 'lodash/entries', 'lodash/clean_html', 'title'
options[:title] = 'Lo-Dash'
options[:container] = 'h1+div+div'
options[:title] = 'lodash'
options[:skip_links] = true
options[:attribution] = <<-HTML

Loading…
Cancel
Save