|
|
|
@ -4,8 +4,8 @@ module Docs
|
|
|
|
|
IGNORE_IDS = %w(
|
|
|
|
|
i18n-loading-into-nodejs
|
|
|
|
|
i18n-loading-into-browser
|
|
|
|
|
i18n-adding-language
|
|
|
|
|
i18n-getting-language)
|
|
|
|
|
i18n-adding-locale
|
|
|
|
|
i18n-getting-locale)
|
|
|
|
|
|
|
|
|
|
def additional_entries
|
|
|
|
|
entries = []
|
|
|
|
@ -17,21 +17,22 @@ module Docs
|
|
|
|
|
next
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
next unless node.name == 'h3'
|
|
|
|
|
next if IGNORE_IDS.include?(node['id'])
|
|
|
|
|
|
|
|
|
|
if node['id'] == 'utilities-invalid' # bug fix
|
|
|
|
|
name = 'moment.invalid()'
|
|
|
|
|
elsif %w(Display Durations Get\ +\ Set i18n Manipulate Query Utilities).include?(type) ||
|
|
|
|
|
%w(parsing-is-valid parsing-parse-zone parsing-unix-timestamp parsing-utc).include?(node['id'])
|
|
|
|
|
%w(parsing-is-valid parsing-parse-zone parsing-unix-timestamp parsing-utc customization-relative-time-threshold).include?(node['id'])
|
|
|
|
|
name = node.next_element.content[/moment(?:\(.*?\))?\.(?:duration\(\)\.)?\w+/]
|
|
|
|
|
name.sub! %r{\(.*?\)\.}, '#'
|
|
|
|
|
name << '()'
|
|
|
|
|
elsif type == 'Customize'
|
|
|
|
|
name = node.next_element.content[/moment.lang\(.+?\{\s+(\w+)/, 1]
|
|
|
|
|
name.prepend 'Language#'
|
|
|
|
|
name = node.next_element.content[/moment.locale\(.+?\{\s+(\w+)/, 1]
|
|
|
|
|
name.prepend 'Locale#'
|
|
|
|
|
else
|
|
|
|
|
name = node.content.strip
|
|
|
|
|
name.remove! %r{\s[\d\.]+\z} # remove version number
|
|
|
|
|
name.remove! %r{\s[\d\.]+[\s\+]*\z} # remove version number
|
|
|
|
|
name.remove! %r{\s\(.+\)\z} # remove parenthesis
|
|
|
|
|
name.prepend 'Parse: ' if type == 'Parse'
|
|
|
|
|
end
|
|
|
|
|