diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 06214a7e..f34f861f 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -577,7 +577,7 @@ credits = [ 'MIT', 'https://modernizr.com/license/' ], [ - 'Moment.js', + 'Moment.js
Moment.js Timezone', 'JS Foundation and other contributors', 'MIT', 'https://raw.githubusercontent.com/moment/moment/master/LICENSE' diff --git a/lib/docs/filters/moment_timezone/entries.rb b/lib/docs/filters/moment_timezone/entries.rb new file mode 100644 index 00000000..7e2005ea --- /dev/null +++ b/lib/docs/filters/moment_timezone/entries.rb @@ -0,0 +1,21 @@ +module Docs + class MomentTimezone + class EntriesFilter < Docs::EntriesFilter + + def additional_entries + entries = [] + type = nil + + css('[id]').each do |node| + if node.name == 'h2' + type = node.content + end + name = node.content.strip + entries << [name, node['id'], type] + end + + entries + end + end + end +end diff --git a/lib/docs/scrapers/moment_timezone.rb b/lib/docs/scrapers/moment_timezone.rb new file mode 100644 index 00000000..225d35f3 --- /dev/null +++ b/lib/docs/scrapers/moment_timezone.rb @@ -0,0 +1,30 @@ +module Docs + class MomentTimezone < UrlScraper + self.name = 'Moment.js Timezone' + self.slug = 'moment_timezone' + self.type = 'moment' + self.release = '0.5.37' + self.base_url = 'https://momentjs.com/timezone' + self.root_path = '/docs/' + self.initial_paths = %w(/docs/) + self.links = { + home: 'https://momentjs.com/timezone/', + code: 'https://github.com/moment/moment-timezone/' + } + + html_filters.push 'moment/clean_html', 'moment_timezone/entries', 'title' + + options[:title] = 'Moment.js Timezone' + options[:container] = '.docs-content' + options[:skip_links] = true + + options[:attribution] = <<-HTML + © JS Foundation and other contributors
+ Licensed under the MIT License. + HTML + + def get_latest_version(opts) + get_github_tags('moment', 'moment-timezone', opts)[0]['name'] + end + end +end diff --git a/public/icons/docs/moment_timezone/16.png b/public/icons/docs/moment_timezone/16.png new file mode 100644 index 00000000..29c6b987 Binary files /dev/null and b/public/icons/docs/moment_timezone/16.png differ diff --git a/public/icons/docs/moment_timezone/16@2x.png b/public/icons/docs/moment_timezone/16@2x.png new file mode 100644 index 00000000..0f8a8e4b Binary files /dev/null and b/public/icons/docs/moment_timezone/16@2x.png differ diff --git a/public/icons/docs/moment_timezone/SOURCE b/public/icons/docs/moment_timezone/SOURCE new file mode 100644 index 00000000..f3616477 --- /dev/null +++ b/public/icons/docs/moment_timezone/SOURCE @@ -0,0 +1 @@ +https://momentjs.com/static/img/moment-timezone-favicon.png \ No newline at end of file