Reuse existing moment files

pull/1828/head
Tim Lim 2 years ago
parent 850366459b
commit 89badcc9ed

@ -87,7 +87,6 @@
'pages/mkdocs',
'pages/modernizr',
'pages/moment',
'pages/moment_timezone',
'pages/nginx',
'pages/node',
'pages/npm',

@ -1,5 +0,0 @@
._moment_timezone {
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
code { @extend %label; }
}

@ -1,29 +0,0 @@
module Docs
class MomentTimezone
class CleanHtmlFilter < Filter
def call
# Set id attributes on headings
css('a.docs-section-target', 'a.docs-method-target').each do |node|
node.next_element['id'] = node['id']
node.remove
end
css('> article', '.docs-method-prose', '.docs-method-signature', 'h2 > a', 'h3 > a', 'pre > code').each do |node|
node.before(node.children).remove
end
css('.docs-method-edit', 'hr').remove
css('pre').each do |node|
if node.content =~ /\A</
node['data-language'] = 'html'
elsif node.content !~ /\A\d/
node['data-language'] = 'javascript'
end
end
doc
end
end
end
end

@ -2,7 +2,7 @@ module Docs
class MomentTimezone < UrlScraper
self.name = 'Moment.js Timezone'
self.slug = 'moment_timezone'
self.type = 'moment_timezone'
self.type = 'moment'
self.release = '0.5.37'
self.base_url = 'https://momentjs.com/timezone'
self.root_path = '/docs/'
@ -12,7 +12,7 @@ module Docs
code: 'https://github.com/moment/moment-timezone/'
}
html_filters.push 'moment_timezone/clean_html', 'moment_timezone/entries', 'title'
html_filters.push 'moment/clean_html', 'moment_timezone/entries', 'title'
options[:title] = 'Moment.js Timezone'
options[:container] = '.docs-content'

Loading…
Cancel
Save