History

Update JavaScript documentation

Thibaut committed 12 years ago

Commit 10b4f441 parent d43d5ff3 files · +12 −5Browse files

Unified · Split

3 files
  1. lib/docs/filters/javascript/clean_html.rb +1 −2
  2. lib/docs/filters/javascript/entries.rb +4 −2
  3. lib/docs/scrapers/mdn/javascript.rb +7 −1
lib/docs/filters/javascript/clean_html.rb+1−2
@@ -7,9 +7,8 @@ module Docs · 6 unmodified lines
7 end7 end
8 8
9 def root9 def root
10 css(*%w(#About_this_Reference+div #About_this_Reference #Comments~* #Comments)).remove
11
12 # Move "Global Objects" lists to the same level as the other ones10 # Move "Global Objects" lists to the same level as the other ones
11 css('#Global_Objects + p').remove
13 div = at_css '#Global_Objects + div'12 div = at_css '#Global_Objects + div'
14 div.css('h3').each { |node| node.name = 'h2' }13 div.css('h3').each { |node| node.name = 'h2' }
15 at_css('#Global_Objects').replace(div.children)14 at_css('#Global_Objects').replace(div.children)
lib/docs/filters/javascript/entries.rb+4−2
@@ -1,7 +1,8 @@
1module Docs1module Docs
2 class Javascript2 class Javascript
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 TYPES = %w(Array Boolean Date Function Intl JSON Math Number Object RegExp String)4 TYPES = %w(Array Boolean Date Function Intl JSON Map Math Number Object
5 RegExp Set String Symbol WeakMap WeakSet)
5 INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat)6 INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat)
6 7
7 def get_name8 def get_name
@@ -19,6 +20,7 @@ module Docs · 11 unmodified lines
19 name20 name
20 else21 else
21 name = super22 name = super
23 name.remove! 'Functions.'
22 name.remove! 'Functions and function scope.'24 name.remove! 'Functions and function scope.'
23 name.remove! 'Operators.'25 name.remove! 'Operators.'
24 name.remove! 'Statements.'26 name.remove! 'Statements.'
@@ -31,7 +33,7 @@ module Docs · 6 unmodified lines
31 'Statements'33 'Statements'
32 elsif slug.start_with? 'Operators'34 elsif slug.start_with? 'Operators'
33 'Operators'35 'Operators'
34 elsif slug.start_with? 'Functions_and_function_scope'36 elsif slug.start_with?('Functions_and_function_scope') || slug.start_with?('Functions')
35 'Function'37 'Function'
36 elsif slug.start_with? 'Global_Objects'38 elsif slug.start_with? 'Global_Objects'
37 object, method = *slug.remove('Global_Objects/').split('/')39 object, method = *slug.remove('Global_Objects/').split('/')
lib/docs/scrapers/mdn/javascript.rb+7−1
@@ -17,8 +17,14 @@ module Docs · 16 unmodified lines
17 /Global_Objects/Iterator17 /Global_Objects/Iterator
18 /Global_Objects/Proxy18 /Global_Objects/Proxy
19 /Reserved_Words19 /Reserved_Words
20 /Functions/arguments
20 /arrow_functions21 /arrow_functions
21 /rest_parameters)22 /rest_parameters
23 /default_parameters
24 /Strict_mode
25 /Functions/rest_parameters
26 /Methods_Index
27 /Properties_Index)
22 28
23 # Duplicates29 # Duplicates
24 options[:skip].concat %w(30 options[:skip].concat %w(