Unified · Split
| @@ -12,13 +12,7 @@ module Docs · 11 unmodified lines | |||
| 12 | node.before(node.children).remove | 12 | node.before(node.children).remove |
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | # Remove introduction | 15 | css('.docs-method-edit', 'hr').remove |
| 16 | doc.child.remove while doc.child['id'] != 'parsing' | ||
| 17 | |||
| 18 | # Remove plugin list | ||
| 19 | doc.children.last.remove while doc.children.last['id'] != 'plugins' | ||
| 20 | |||
| 21 | css('.docs-method-edit', '#plugins', 'hr').remove | ||
| 22 | 16 | ||
| 23 | css('pre').each do |node| | 17 | css('pre').each do |node| |
| 24 | if node.content =~ /\A</ | 18 | if node.content =~ /\A</ |
| @@ -1,12 +1,28 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Moment | 2 | class Moment |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | IGNORE_TYPES = %w( | ||
| 5 | Where\ to\ use\ it | ||
| 6 | Plugins | ||
| 7 | Guides:\ External\ Resources) | ||
| 4 | IGNORE_IDS = %w( | 8 | IGNORE_IDS = %w( |
| 5 | i18n-loading-into-nodejs | 9 | i18n-loading-into-nodejs |
| 6 | i18n-loading-into-browser | 10 | i18n-loading-into-browser |
| 7 | i18n-adding-locale | 11 | i18n-adding-locale |
| 8 | i18n-getting-locale) | 12 | i18n-getting-locale) |
| 9 | 13 | ||
| 14 | def get_name | ||
| 15 | if subpath == '/guides/' | ||
| 16 | 'Guides' | ||
| 17 | end | ||
| 18 | end | ||
| 19 | |||
| 20 | def get_type | ||
| 21 | if subpath == '/guides/' | ||
| 22 | 'Guides' | ||
| 23 | end | ||
| 24 | end | ||
| 25 | |||
| 10 | def additional_entries | 26 | def additional_entries |
| 11 | entries = [] | 27 | entries = [] |
| 12 | type = nil | 28 | type = nil |
| @@ -14,10 +30,13 @@ module Docs · 1 unmodified line | |||
| 14 | css('[id]').each do |node| | 30 | css('[id]').each do |node| |
| 15 | if node.name == 'h2' | 31 | if node.name == 'h2' |
| 16 | type = node.content | 32 | type = node.content |
| 33 | type.remove! ' Guide' | ||
| 34 | type.prepend 'Guides: ' if subpath == '/guides/' | ||
| 17 | next | 35 | next |
| 18 | end | 36 | end |
| 19 | 37 | ||
| 20 | next unless node.name == 'h3' | 38 | next unless node.name == 'h3' |
| 39 | next if IGNORE_TYPES.include?(type) | ||
| 21 | next if IGNORE_IDS.include?(node['id']) | 40 | next if IGNORE_IDS.include?(node['id']) |
| 22 | 41 | ||
| 23 | if node['id'] == 'utilities-invalid' # bug fix | 42 | if node['id'] == 'utilities-invalid' # bug fix |
| @@ -3,8 +3,10 @@ module Docs · 2 unmodified lines | |||
| 3 | self.name = 'Moment.js' | 3 | self.name = 'Moment.js' |
| 4 | self.slug = 'moment' | 4 | self.slug = 'moment' |
| 5 | self.type = 'moment' | 5 | self.type = 'moment' |
| 6 | self.release = '2.15.2' | 6 | self.release = '2.16.0' |
| 7 | self.base_url = 'http://momentjs.com/docs/' | 7 | self.base_url = 'http://momentjs.com' |
| 8 | self.root_path = '/docs/' | ||
| 9 | self.initial_paths = %w(/guides/) | ||
| 8 | 10 | ||
| 9 | html_filters.push 'moment/clean_html', 'moment/entries', 'title' | 11 | html_filters.push 'moment/clean_html', 'moment/entries', 'title' |
| 10 | 12 | ||