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
77 end
88
99 def root
10− css(*%w(#About_this_Reference+div #About_this_Reference #Comments~* #Comments)).remove
11−
1210 # Move "Global Objects" lists to the same level as the other ones
11+ css('#Global_Objects + p').remove
1312 div = at_css '#Global_Objects + div'
1413 div.css('h3').each { |node| node.name = 'h2' }
1514 at_css('#Global_Objects').replace(div.children)
lib/docs/filters/javascript/entries.rb+4−2
@@ -1,7 +1,8 @@
11 module Docs
22 class Javascript
33 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)
56 INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat)
67
78 def get_name
@@ -19,6 +20,7 @@ module Docs · 11 unmodified lines
1920 name
2021 else
2122 name = super
23+ name.remove! 'Functions.'
2224 name.remove! 'Functions and function scope.'
2325 name.remove! 'Operators.'
2426 name.remove! 'Statements.'
@@ -31,7 +33,7 @@ module Docs · 6 unmodified lines
3133 'Statements'
3234 elsif slug.start_with? 'Operators'
3335 'Operators'
34− elsif slug.start_with? 'Functions_and_function_scope'
36+ elsif slug.start_with?('Functions_and_function_scope') || slug.start_with?('Functions')
3537 'Function'
3638 elsif slug.start_with? 'Global_Objects'
3739 object, method = *slug.remove('Global_Objects/').split('/')
lib/docs/scrapers/mdn/javascript.rb+7−1
@@ -17,8 +17,14 @@ module Docs · 16 unmodified lines
1717 /Global_Objects/Iterator
1818 /Global_Objects/Proxy
1919 /Reserved_Words
20+ /Functions/arguments
2021 /arrow_functions
21− /rest_parameters)
22+ /rest_parameters
23+ /default_parameters
24+ /Strict_mode
25+ /Functions/rest_parameters
26+ /Methods_Index
27+ /Properties_Index)
2228
2329 # Duplicates
2430 options[:skip].concat %w(