From 0699fee649ebe1520d78b76b2e6e60bf6cfb3326 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 18 Oct 2014 13:43:45 -0400 Subject: [PATCH] Add aliases to Lo-Dash documentation Fixes #68. --- assets/javascripts/templates/pages/about_tmpl.coffee | 2 +- lib/docs/filters/lodash/entries.rb | 6 ++++++ lib/docs/scrapers/lodash.rb | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 9c79c5c2..7ce9a0e7 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -189,7 +189,7 @@ credits = [ 'http://creativecommons.org/licenses/by/3.0/' ], [ 'Lo-Dash', - '2009-2013 The Dojo Foundation', + '2009-2014 The Dojo Foundation', 'MIT', 'https://raw.github.com/lodash/lodash/master/LICENSE.txt' ], [ diff --git a/lib/docs/filters/lodash/entries.rb b/lib/docs/filters/lodash/entries.rb index cdffb170..fb93b925 100644 --- a/lib/docs/filters/lodash/entries.rb +++ b/lib/docs/filters/lodash/entries.rb @@ -12,6 +12,12 @@ module Docs 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 end end diff --git a/lib/docs/scrapers/lodash.rb b/lib/docs/scrapers/lodash.rb index 4cb9d52b..130e9062 100644 --- a/lib/docs/scrapers/lodash.rb +++ b/lib/docs/scrapers/lodash.rb @@ -4,7 +4,7 @@ module Docs self.slug = 'lodash' self.type = 'lodash' self.version = '2.4.1' - self.base_url = 'http://lodash.com/docs' + self.base_url = 'https://lodash.com/docs' html_filters.push 'lodash/clean_html', 'lodash/entries', 'title' @@ -13,7 +13,7 @@ module Docs options[:skip_links] = true options[:attribution] = <<-HTML - © 2012–2013 The Dojo Foundation
+ © 2012–2014 The Dojo Foundation
Licensed under the MIT License. HTML end