Преглед на файлове

Add aliases to Lo-Dash documentation

Fixes #68.
Thibaut преди 11 години
родител
ревизия
0699fee649
променени са 3 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 1 1
      assets/javascripts/templates/pages/about_tmpl.coffee
  2. 6 0
      lib/docs/filters/lodash/entries.rb
  3. 2 2
      lib/docs/scrapers/lodash.rb

+ 1 - 1
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'
   ], [

+ 6 - 0
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
 

+ 2 - 2
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
-      &copy; 2012&ndash;2013 The Dojo Foundation<br>
+      &copy; 2012&ndash;2014 The Dojo Foundation<br>
       Licensed under the MIT License.
     HTML
   end