|
|
@ -6,10 +6,11 @@ module Docs
|
|
|
|
Plugins
|
|
|
|
Plugins
|
|
|
|
Guides:\ External\ Resources)
|
|
|
|
Guides:\ External\ Resources)
|
|
|
|
IGNORE_IDS = %w(
|
|
|
|
IGNORE_IDS = %w(
|
|
|
|
i18n-loading-into-nodejs
|
|
|
|
/i18n/loading-into-nodejs/
|
|
|
|
i18n-loading-into-browser
|
|
|
|
/i18n/loading-into-browser/
|
|
|
|
i18n-adding-locale
|
|
|
|
/i18n/adding-locale/
|
|
|
|
i18n-getting-locale)
|
|
|
|
/i18n/getting-locale/
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def get_name
|
|
|
|
def get_name
|
|
|
|
if subpath == '/guides/'
|
|
|
|
if subpath == '/guides/'
|
|
|
@ -39,26 +40,30 @@ module Docs
|
|
|
|
next if IGNORE_TYPES.include?(type)
|
|
|
|
next if IGNORE_TYPES.include?(type)
|
|
|
|
next if IGNORE_IDS.include?(node['id'])
|
|
|
|
next if IGNORE_IDS.include?(node['id'])
|
|
|
|
|
|
|
|
|
|
|
|
if node['id'] == 'utilities-invalid' # bug fix
|
|
|
|
if %w(Display Durations Get\ +\ Set i18n Manipulate Query Utilities).include?(type) ||
|
|
|
|
name = 'moment.invalid()'
|
|
|
|
%w(/parsing/is-valid/
|
|
|
|
elsif node['id'] == 'customization-now'
|
|
|
|
/parsing/parse-zone/
|
|
|
|
name = 'moment.now'
|
|
|
|
/parsing/unix-timestamp/
|
|
|
|
elsif %w(Display Durations Get\ +\ Set i18n Manipulate Query Utilities).include?(type) ||
|
|
|
|
/parsing/utc/
|
|
|
|
%w(parsing-is-valid parsing-parse-zone parsing-unix-timestamp parsing-utc parsing-creation-data customization-relative-time-threshold customization-relative-time-rounding
|
|
|
|
/parsing/creation-data/
|
|
|
|
customization-calendar-format).include?(node['id'])
|
|
|
|
/customization/relative-time-threshold/
|
|
|
|
|
|
|
|
/customization/relative-time-rounding/
|
|
|
|
|
|
|
|
/customization/calendar-format/
|
|
|
|
|
|
|
|
/customization/now/
|
|
|
|
|
|
|
|
).include?(node['id'])
|
|
|
|
name = node.next_element.content[/moment(?:\(.*?\))?\.(?:duration\(\)\.)?\w+/]
|
|
|
|
name = node.next_element.content[/moment(?:\(.*?\))?\.(?:duration\(\)\.)?\w+/]
|
|
|
|
name.sub! %r{\(.*?\)\.}, '#'
|
|
|
|
name.sub! %r{\(.*?\)\.}, '#'
|
|
|
|
name << '()'
|
|
|
|
name << '()'
|
|
|
|
elsif type == 'Customize'
|
|
|
|
elsif type == 'Customize'
|
|
|
|
name = node.next_element.content[/moment.locale\(.+?\{\s+(\w+)/, 1]
|
|
|
|
name = node.next_element.content[/moment.locale\(.+?\{\s+(\w+)/, 1]
|
|
|
|
|
|
|
|
name = node.content.strip unless name
|
|
|
|
name.prepend 'Locale#'
|
|
|
|
name.prepend 'Locale#'
|
|
|
|
else
|
|
|
|
else
|
|
|
|
name = node.content.strip
|
|
|
|
name = node.content.strip
|
|
|
|
name.remove! %r{\s[\d\.]+[\s\+]*\z} # remove version number
|
|
|
|
|
|
|
|
name.remove! %r{\s\(.+\)\z} # remove parenthesis
|
|
|
|
|
|
|
|
name.prepend 'Parse: ' if type == 'Parse'
|
|
|
|
name.prepend 'Parse: ' if type == 'Parse'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
name.remove! %r{\s[\d\.]+[\s\+]*\z} # remove version number
|
|
|
|
|
|
|
|
name.remove! %r{\s\(.+\)\z} # remove parenthesis
|
|
|
|
entries << [name, node['id'], type]
|
|
|
|
entries << [name, node['id'], type]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|