Unified · Split
| @@ -581,6 +581,11 @@ credits = [ · 580 unmodified lines | ||
| 581 | 581 | 'JS Foundation and other contributors', |
| 582 | 582 | 'MIT', |
| 583 | 583 | 'https://raw.githubusercontent.com/moment/moment/master/LICENSE' |
| 584 | + ], [ | |
| 585 | + 'Moment.js Timezone', | |
| 586 | + 'JS Foundation and other contributors', | |
| 587 | + 'MIT', | |
| 588 | + 'https://raw.githubusercontent.com/moment/moment-timezone/master/LICENSE' | |
| 584 | 589 | ], [ |
| 585 | 590 | 'Mongoose', |
| 586 | 591 | '2010 LearnBoost', |
| @@ -87,6 +87,7 @@ · 86 unmodified lines | ||
| 87 | 87 | 'pages/mkdocs', |
| 88 | 88 | 'pages/modernizr', |
| 89 | 89 | 'pages/moment', |
| 90 | + 'pages/moment_timezone', | |
| 90 | 91 | 'pages/nginx', |
| 91 | 92 | 'pages/node', |
| 92 | 93 | 'pages/npm', |
| @@ -0,0 +1,5 @@ | ||
| 1 | +._moment_timezone { | |
| 2 | + > h2 { @extend %block-heading; } | |
| 3 | + > h3 { @extend %block-label, %label-blue; } | |
| 4 | + code { @extend %label; } | |
| 5 | +} | |
| @@ -0,0 +1,29 @@ | ||
| 1 | +module Docs | |
| 2 | + class MomentTimezone | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Set id attributes on headings | |
| 6 | + css('a.docs-section-target', 'a.docs-method-target').each do |node| | |
| 7 | + node.next_element['id'] = node['id'] | |
| 8 | + node.remove | |
| 9 | + end | |
| 10 | + | |
| 11 | + css('> article', '.docs-method-prose', '.docs-method-signature', 'h2 > a', 'h3 > a', 'pre > code').each do |node| | |
| 12 | + node.before(node.children).remove | |
| 13 | + end | |
| 14 | + | |
| 15 | + css('.docs-method-edit', 'hr').remove | |
| 16 | + | |
| 17 | + css('pre').each do |node| | |
| 18 | + if node.content =~ /\A</ | |
| 19 | + node['data-language'] = 'html' | |
| 20 | + elsif node.content !~ /\A\d/ | |
| 21 | + node['data-language'] = 'javascript' | |
| 22 | + end | |
| 23 | + end | |
| 24 | + | |
| 25 | + doc | |
| 26 | + end | |
| 27 | + end | |
| 28 | + end | |
| 29 | +end | |
| @@ -0,0 +1,23 @@ | ||
| 1 | +module Docs | |
| 2 | + class MomentTimezone | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + | |
| 5 | + def additional_entries | |
| 6 | + entries = [] | |
| 7 | + type = nil | |
| 8 | + | |
| 9 | + css('[id]').each do |node| | |
| 10 | + if node.name == 'h2' | |
| 11 | + type = node.content | |
| 12 | + name = "Intro" | |
| 13 | + else | |
| 14 | + name = node.content.strip | |
| 15 | + end | |
| 16 | + entries << [name, node['id'], type] | |
| 17 | + end | |
| 18 | + | |
| 19 | + entries | |
| 20 | + end | |
| 21 | + end | |
| 22 | + end | |
| 23 | +end | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +module Docs | |
| 2 | + class MomentTimezone < UrlScraper | |
| 3 | + self.name = 'Moment.js Timezone' | |
| 4 | + self.slug = 'moment_timezone' | |
| 5 | + self.type = 'moment_timezone' | |
| 6 | + self.release = '0.5.37' | |
| 7 | + self.base_url = 'https://momentjs.com/timezone' | |
| 8 | + self.root_path = '/docs/' | |
| 9 | + self.initial_paths = %w(/docs/) | |
| 10 | + self.links = { | |
| 11 | + home: 'http://momentjs.com/timezone/', | |
| 12 | + code: 'https://github.com/moment/moment-timezone/' | |
| 13 | + } | |
| 14 | + | |
| 15 | + html_filters.push 'moment_timezone/clean_html', 'moment_timezone/entries', 'title' | |
| 16 | + | |
| 17 | + options[:title] = 'Moment.js Timezone' | |
| 18 | + options[:container] = '.docs-content' | |
| 19 | + options[:skip_links] = true | |
| 20 | + | |
| 21 | + options[:attribution] = <<-HTML | |
| 22 | + © JS Foundation and other contributors<br> | |
| 23 | + Licensed under the MIT License. | |
| 24 | + HTML | |
| 25 | + | |
| 26 | + def get_latest_version(opts) | |
| 27 | + get_github_tags('moment', 'moment-timezone', opts)[0]['name'] | |
| 28 | + end | |
| 29 | + end | |
| 30 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://momentjs.com/static/img/moment-timezone-favicon.png | |