Преглед на файлове

Reuse existing moment files

Tim Lim преди 3 години
родител
ревизия
89badcc9ed

+ 0 - 1
assets/stylesheets/application.css.scss

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

+ 0 - 5
assets/stylesheets/pages/_moment_timezone.scss

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

+ 0 - 29
lib/docs/filters/moment_timezone/clean_html.rb

@@ -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 - 2
lib/docs/scrapers/moment_timezone.rb

@@ -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'