Unified · Split
| @@ -53,6 +53,10 @@ module Docs · 52 unmodified lines | ||
| 53 | 53 | node.name = 'h4' |
| 54 | 54 | end |
| 55 | 55 | |
| 56 | + css('thead td').each do |node| | |
| 57 | + node.name = 'th' | |
| 58 | + end | |
| 59 | + | |
| 56 | 60 | css('table, tr, td, th, pre, code').each do |node| |
| 57 | 61 | node.remove_attribute('class') |
| 58 | 62 | node.remove_attribute('style') |
| @@ -4,24 +4,22 @@ module Docs · 3 unmodified lines | ||
| 4 | 4 | def get_name |
| 5 | 5 | name = at_css('.bd-content h1').content.strip |
| 6 | 6 | name.remove! ' system' |
| 7 | − return type if name == 'Overview' | |
| 8 | − name.prepend 'Utilities: ' if subpath.start_with?('utilities') | |
| 9 | − name | |
| 7 | + name == 'Overview' ? type : name | |
| 10 | 8 | end |
| 11 | 9 | |
| 12 | 10 | def get_type |
| 13 | 11 | if subpath.start_with?('components') |
| 14 | 12 | at_css('.bd-content h1').content.strip.prepend 'Components: ' |
| 15 | 13 | else |
| 16 | − at_css('.bd-pageheader h1').content | |
| 14 | + at_css('.bd-toc-item.active > .bd-toc-link').content | |
| 17 | 15 | end |
| 18 | 16 | end |
| 19 | 17 | |
| 20 | 18 | def additional_entries |
| 21 | − return [] if root_page? || subpath.start_with?('getting-started') | |
| 19 | + return [] if root_page? || subpath.start_with?('getting-started') || subpath.start_with?('migration') | |
| 22 | 20 | entries = [] |
| 23 | 21 | |
| 24 | − css('#markdown-toc > li > a', '#markdown-toc > li li #markdown-toc-events').each do |node| | |
| 22 | + css('.bd-toc > ul > li > a', '.bd-toc a[href="#events"]', '.bd-toc a[href="#methods"]', '.bd-toc a[href="#triggers"]').each do |node| | |
| 25 | 23 | name = node.content |
| 26 | 24 | next if name =~ /example/i || IGNORE_ENTRIES.include?(name) |
| 27 | 25 | name.downcase! |
| @@ -48,17 +46,26 @@ module Docs · 20 unmodified lines | ||
| 48 | 46 | entries << [name, id] |
| 49 | 47 | end |
| 50 | 48 | |
| 49 | + css("#events ~ table tbody td:first-child").each do |node| | |
| 50 | + name = node.content.strip | |
| 51 | + unless id = node.parent['id'] | |
| 52 | + id = node.parent['id'] = "#{name.parameterize}-event" | |
| 53 | + end | |
| 54 | + name.prepend "#{self.name}: " | |
| 55 | + name << ' (event)' | |
| 56 | + entries << [name, id] | |
| 57 | + end | |
| 58 | + | |
| 51 | 59 | entries |
| 52 | 60 | end |
| 53 | 61 | |
| 54 | 62 | IGNORE_ENTRIES = %w( |
| 55 | − Contents | |
| 56 | 63 | How\ it\ works |
| 57 | 64 | Approach |
| 58 | 65 | JavaScript\ behavior |
| 59 | 66 | Usage |
| 60 | − Basics | |
| 61 | 67 | Overview |
| 68 | + About | |
| 62 | 69 | ) |
| 63 | 70 | end |
| 64 | 71 | end |
| @@ -6,7 +6,7 @@ module Docs · 5 unmodified lines | ||
| 6 | 6 | code: 'https://github.com/twbs/bootstrap' |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | − options[:trailing_slash] = false | |
| 9 | + options[:trailing_slash] = true | |
| 10 | 10 | |
| 11 | 11 | options[:attribution] = <<-HTML |
| 12 | 12 | © 2011–2017 Twitter, Inc.<br> |
| @@ -16,31 +16,23 @@ module Docs · 3 unmodified lines | ||
| 16 | 16 | HTML |
| 17 | 17 | |
| 18 | 18 | version '4' do |
| 19 | − self.release = 'alpha.6' | |
| 20 | − self.base_url = 'https://v4-alpha.getbootstrap.com/' | |
| 21 | − self.root_path = 'getting-started/introduction' | |
| 19 | + self.release = '4.0.0-beta' | |
| 20 | + self.base_url = 'https://getbootstrap.com/docs/4.0/' | |
| 21 | + self.root_path = 'getting-started/introduction/' | |
| 22 | 22 | |
| 23 | 23 | html_filters.push 'bootstrap/entries_v4', 'bootstrap/clean_html_v4' |
| 24 | 24 | |
| 25 | − options[:only_patterns] = [/\Agetting-started\//, /\Alayout\//, /\Acontent\//, /\Acomponents\//, /\Autilities\//] | |
| 25 | + options[:only_patterns] = [/\Agetting-started\//, /\Alayout\//, /\Acontent\//, /\Acomponents\//, /\Autilities\//, /\Amigration\//] | |
| 26 | 26 | end |
| 27 | 27 | |
| 28 | 28 | version '3' do |
| 29 | 29 | self.release = '3.3.7' |
| 30 | − self.base_url = 'https://getbootstrap.com/' | |
| 31 | − self.root_path = 'getting-started' | |
| 30 | + self.base_url = 'https://getbootstrap.com/docs/3.3/' | |
| 31 | + self.root_path = 'getting-started/' | |
| 32 | 32 | |
| 33 | 33 | html_filters.push 'bootstrap/entries_v3', 'bootstrap/clean_html_v3' |
| 34 | 34 | |
| 35 | − options[:only] = %w(getting-started css components javascript) | |
| 36 | − end | |
| 37 | − | |
| 38 | − private | |
| 39 | − | |
| 40 | − def handle_response(response) | |
| 41 | − response.effective_url.scheme = 'https' | |
| 42 | − response.effective_url.path = response.effective_url.path.remove(/\/\z/) | |
| 43 | − super | |
| 35 | + options[:only] = %w(getting-started/ css/ components/ javascript/) | |
| 44 | 36 | end |
| 45 | 37 | end |
| 46 | 38 | end |