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