From 10b4f445f7c2c911ec4568dd181501ecb23f235c Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 7 Sep 2014 13:05:10 -0400 Subject: [PATCH] Update JavaScript documentation --- lib/docs/filters/javascript/clean_html.rb | 3 +-- lib/docs/filters/javascript/entries.rb | 6 ++++-- lib/docs/scrapers/mdn/javascript.rb | 8 +++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/docs/filters/javascript/clean_html.rb b/lib/docs/filters/javascript/clean_html.rb index 4ad954de..a4f07fc8 100644 --- a/lib/docs/filters/javascript/clean_html.rb +++ b/lib/docs/filters/javascript/clean_html.rb @@ -7,9 +7,8 @@ module Docs end def root - css(*%w(#About_this_Reference+div #About_this_Reference #Comments~* #Comments)).remove - # Move "Global Objects" lists to the same level as the other ones + css('#Global_Objects + p').remove div = at_css '#Global_Objects + div' div.css('h3').each { |node| node.name = 'h2' } at_css('#Global_Objects').replace(div.children) diff --git a/lib/docs/filters/javascript/entries.rb b/lib/docs/filters/javascript/entries.rb index fab954cc..5e7e3060 100644 --- a/lib/docs/filters/javascript/entries.rb +++ b/lib/docs/filters/javascript/entries.rb @@ -1,7 +1,8 @@ module Docs class Javascript class EntriesFilter < Docs::EntriesFilter - TYPES = %w(Array Boolean Date Function Intl JSON Math Number Object RegExp String) + TYPES = %w(Array Boolean Date Function Intl JSON Map Math Number Object + RegExp Set String Symbol WeakMap WeakSet) INTL_OBJECTS = %w(Collator DateTimeFormat NumberFormat) def get_name @@ -19,6 +20,7 @@ module Docs name else name = super + name.remove! 'Functions.' name.remove! 'Functions and function scope.' name.remove! 'Operators.' name.remove! 'Statements.' @@ -31,7 +33,7 @@ module Docs 'Statements' elsif slug.start_with? 'Operators' 'Operators' - elsif slug.start_with? 'Functions_and_function_scope' + elsif slug.start_with?('Functions_and_function_scope') || slug.start_with?('Functions') 'Function' elsif slug.start_with? 'Global_Objects' object, method = *slug.remove('Global_Objects/').split('/') diff --git a/lib/docs/scrapers/mdn/javascript.rb b/lib/docs/scrapers/mdn/javascript.rb index 1ccc7286..57c04b66 100644 --- a/lib/docs/scrapers/mdn/javascript.rb +++ b/lib/docs/scrapers/mdn/javascript.rb @@ -17,8 +17,14 @@ module Docs /Global_Objects/Iterator /Global_Objects/Proxy /Reserved_Words + /Functions/arguments /arrow_functions - /rest_parameters) + /rest_parameters + /default_parameters + /Strict_mode + /Functions/rest_parameters + /Methods_Index + /Properties_Index) # Duplicates options[:skip].concat %w(