Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | + "2016-07-31", | |
| 4 | + "New documentation: <a href=\"/bootstrap/\">Bootstrap</a>" | |
| 5 | + ], [ | |
| 3 | 6 | "2016-07-24", |
| 4 | 7 | "New documentations: <a href=\"/julia/\">Julia</a>, <a href=\"/crystal/\">Crystal</a> and <a href=\"/redux/\">Redux</a>" |
| 5 | 8 | ], [ |
| @@ -105,6 +105,11 @@ credits = [ · 104 unmodified lines | ||
| 105 | 105 | '2010-2016 Jeremy Ashkenas, DocumentCloud', |
| 106 | 106 | 'MIT', |
| 107 | 107 | 'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE' |
| 108 | + ], [ | |
| 109 | + 'Bootstrap', | |
| 110 | + '2011-2016 Twitter, Inc.', | |
| 111 | + 'CC BY', | |
| 112 | + 'https://creativecommons.org/licenses/by/3.0/' | |
| 108 | 113 | ], [ |
| 109 | 114 | 'Bower', |
| 110 | 115 | '2016 Bower contributors', |
| @@ -8,6 +8,7 @@ class app.views.SimplePage extends app.views.BasePage · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | app.views.AngularPage = |
| 10 | 10 | app.views.AngularjsPage = |
| 11 | +app.views.Bsv3Page = | |
| 11 | 12 | app.views.CakephpPage = |
| 12 | 13 | app.views.ChaiPage = |
| 13 | 14 | app.views.CrystalPage = |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | 'pages/angular', |
| 35 | 35 | 'pages/angularjs', |
| 36 | 36 | 'pages/apache', |
| 37 | + 'pages/bootstrap', | |
| 37 | 38 | 'pages/bower', |
| 38 | 39 | 'pages/c', |
| 39 | 40 | 'pages/cakephp', |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | 'pages/angular', |
| 35 | 35 | 'pages/angularjs', |
| 36 | 36 | 'pages/apache', |
| 37 | + 'pages/bootstrap', | |
| 37 | 38 | 'pages/bower', |
| 38 | 39 | 'pages/c', |
| 39 | 40 | 'pages/cakephp', |
| @@ -133,6 +133,7 @@ · 132 unmodified lines | ||
| 133 | 133 | ._icon-crystal:before { background-position: -6rem -8rem; @extend %darkIconFix !optional; } |
| 134 | 134 | ._icon-julia:before { background-position: -7rem -8rem; @extend %darkIconFix !optional; } |
| 135 | 135 | ._icon-redux:before { background-position: -8rem -8rem; @extend %darkIconFix !optional; } |
| 136 | +._icon-bootstrap:before { background-position: -9rem -8rem; } | |
| 136 | 137 | ._icon-react_native:before { background-position: 0 -9rem; } |
| 137 | 138 | ._icon-phalcon:before { background-position: -1rem -9rem; } |
| 138 | 139 | ._icon-matplotlib:before { background-position: -2rem -9rem; } |
| @@ -0,0 +1,62 @@ | ||
| 1 | +._bsv3 { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | + h4 > code, h5 > code { @extend %label; } | |
| 5 | + | |
| 6 | + h2 > small { | |
| 7 | + color: $textColorLight; | |
| 8 | + float: right; | |
| 9 | + } | |
| 10 | + | |
| 11 | + .bs-callout { @extend %note; } | |
| 12 | + .bs-callout-info { @extend %note-blue; } | |
| 13 | + .bs-callout-danger { @extend %note-red; } | |
| 14 | + .bs-callout > h4, .bs-callout > h5 { margin-top: .25rem; } | |
| 15 | + | |
| 16 | + .text-danger { @extend %label, %label-red; } | |
| 17 | + | |
| 18 | + .bs-example { | |
| 19 | + padding: .375rem .625rem; | |
| 20 | + line-height: 1.5; | |
| 21 | + @extend %heading-box; | |
| 22 | + } | |
| 23 | + | |
| 24 | + div.bs-example { | |
| 25 | + border-bottom-left-radius: 0; | |
| 26 | + border-bottom-right-radius: 0; | |
| 27 | + | |
| 28 | + + pre { | |
| 29 | + border-top-left-radius: 0; | |
| 30 | + border-top-right-radius: 0; | |
| 31 | + border-top: 0; | |
| 32 | + margin-top: 0; | |
| 33 | + } | |
| 34 | + } | |
| 35 | + | |
| 36 | + a.thumbnail { | |
| 37 | + display: block; | |
| 38 | + padding: .25em; | |
| 39 | + @extend %box; | |
| 40 | + | |
| 41 | + &:after { content: none; } | |
| 42 | + + h4 { margin: .75em 0 .5em; } | |
| 43 | + > img { display: block; } | |
| 44 | + } | |
| 45 | + | |
| 46 | + .col { margin-bottom: 1.5em; } | |
| 47 | + | |
| 48 | + @media (min-width: 800px) { | |
| 49 | + .row { | |
| 50 | + display: flex; | |
| 51 | + flex-wrap: wrap; | |
| 52 | + } | |
| 53 | + | |
| 54 | + .col { | |
| 55 | + flex: 0 1 auto; | |
| 56 | + padding: 0 1em; | |
| 57 | + width: 33.33%; | |
| 58 | + -moz-box-sizing: border-box; | |
| 59 | + box-sizing: border-box; | |
| 60 | + } | |
| 61 | + } | |
| 62 | +} | |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | h1, h2, h3 { margin-left: 0; } |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | − p > code, li > code { @extend %label; } | |
| 15 | + p > code, li > code, td > code { @extend %label; } | |
| 16 | 16 | blockquote { @extend %note; } |
| 17 | 17 | blockquote > h4, blockquote > h5 { margin-top: .25rem; } |
| 18 | 18 | } |
| @@ -0,0 +1,64 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bootstrap | |
| 3 | + class CleanHtmlV3Filter < Filter | |
| 4 | + def call | |
| 5 | + at_css('div[role=main]').child.before(at_css('#content .container').inner_html) | |
| 6 | + @doc = at_css('div[role=main]') | |
| 7 | + | |
| 8 | + css('h1, h2, h3, h4, h5').each do |node| | |
| 9 | + node.name = node.name.sub(/\d/) { |i| i.to_i + 1 } | |
| 10 | + end | |
| 11 | + at_css('h2').name = 'h1' | |
| 12 | + | |
| 13 | + css('hr', '.zero-clipboard', '.modal', '.panel-group').remove | |
| 14 | + | |
| 15 | + css('.bs-docs-section', '.table-responsive').each do |node| | |
| 16 | + node.before(node.children).remove | |
| 17 | + end | |
| 18 | + | |
| 19 | + css('> .show-grid', '.bs-example', '.bs-glyphicons', '.responsive-utilities-test').each do |node| | |
| 20 | + if node.previous_element['class'].try(:include?, 'bs-example') | |
| 21 | + node.remove | |
| 22 | + else | |
| 23 | + node.content = '' | |
| 24 | + node.name = 'p' | |
| 25 | + node['class'] = 'bs-example' | |
| 26 | + node.remove_attribute('data-example-id') | |
| 27 | + prev = node.previous_element | |
| 28 | + prev = prev.previous_element until prev['id'] | |
| 29 | + node.inner_html = %(<a href="#{current_url}/##{prev['id']}">Open example on getbootstrap.com</a>) | |
| 30 | + end | |
| 31 | + end | |
| 32 | + | |
| 33 | + css('.bs-example + figure').each do |node| | |
| 34 | + node.previous_element.name = 'div' | |
| 35 | + end | |
| 36 | + | |
| 37 | + css('div[class*="col-"]').each do |node| | |
| 38 | + node['class'] = 'col' | |
| 39 | + end | |
| 40 | + | |
| 41 | + css('.__cf_email__').each do |node| | |
| 42 | + node.replace(decode_cloudflare_email(node['data-cfemail'])) | |
| 43 | + end | |
| 44 | + | |
| 45 | + css('figure.highlight').each do |node| | |
| 46 | + code = node.at_css('code') | |
| 47 | + node['data-language'] = code['data-lang'] | |
| 48 | + node.content = code.content | |
| 49 | + node.name = 'pre' | |
| 50 | + end | |
| 51 | + | |
| 52 | + css('table, tr, td, th, pre').each do |node| | |
| 53 | + node.remove_attribute('class') | |
| 54 | + end | |
| 55 | + | |
| 56 | + css('thead td:empty').each do |node| | |
| 57 | + node.name = 'th' | |
| 58 | + end | |
| 59 | + | |
| 60 | + doc | |
| 61 | + end | |
| 62 | + end | |
| 63 | + end | |
| 64 | +end | |
| @@ -0,0 +1,65 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bootstrap | |
| 3 | + class EntriesV3Filter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + name | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + return [] if root_page? | |
| 14 | + entries = [] | |
| 15 | + | |
| 16 | + css('.bs-docs-sidenav > li').each do |node| | |
| 17 | + link = node.at_css('a') | |
| 18 | + name = link.content | |
| 19 | + next if IGNORE_ENTRIES.include?(name) | |
| 20 | + | |
| 21 | + id = link['href'].remove('#') | |
| 22 | + entries << [name, id] | |
| 23 | + next if name =~ /Sass|Less|Glyphicons/ | |
| 24 | + | |
| 25 | + node.css('> ul > li > a').each do |link| | |
| 26 | + n = link.content | |
| 27 | + next if n.start_with?('Ex: ') || n.start_with?('Default ') || n =~ /example/i || IGNORE_ENTRIES.include?(n) | |
| 28 | + id = link['href'].remove('#') | |
| 29 | + n.downcase! | |
| 30 | + n.prepend "#{name}: " | |
| 31 | + entries << [n, id] | |
| 32 | + end | |
| 33 | + end | |
| 34 | + | |
| 35 | + %w(modals dropdowns scrollspy tabs tooltips popovers alerts buttons collapse carousel affix).each do |dom_id| | |
| 36 | + css("##{dom_id}-options + p + div tbody td:first-child").each do |node| | |
| 37 | + name = node.content.strip | |
| 38 | + id = node.parent['id'] = "#{dom_id}-#{name.parameterize}-option" | |
| 39 | + name.prepend "#{dom_id.singularize.titleize}: " | |
| 40 | + name << ' (option)' | |
| 41 | + entries << [name, id] | |
| 42 | + end | |
| 43 | + | |
| 44 | + css("##{dom_id}-methods ~ h4 code").each do |node| | |
| 45 | + next unless name = node.content[/\('(\w+)'\)/, 1] | |
| 46 | + id = node.parent['id'] = "#{dom_id}-#{name.parameterize}-method" | |
| 47 | + name.prepend "#{dom_id.singularize.titleize}: " | |
| 48 | + name << ' (method)' | |
| 49 | + entries << [name, id] | |
| 50 | + end | |
| 51 | + end | |
| 52 | + | |
| 53 | + entries | |
| 54 | + end | |
| 55 | + | |
| 56 | + IGNORE_ENTRIES = %w( | |
| 57 | + Overview | |
| 58 | + Introduction | |
| 59 | + Usage | |
| 60 | + Methods | |
| 61 | + Options | |
| 62 | + ) | |
| 63 | + end | |
| 64 | + end | |
| 65 | +end | |
| @@ -0,0 +1,33 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bootstrap < UrlScraper | |
| 3 | + options[:attribution] = <<-HTML | |
| 4 | + © 2011–2016 Twitter, Inc.<br> | |
| 5 | + Code licensed under the MIT License.<br> | |
| 6 | + Documentation licensed under the Creative Commons Attribution License v3.0. | |
| 7 | + HTML | |
| 8 | + | |
| 9 | + version '3' do | |
| 10 | + self.type = 'bsv3' | |
| 11 | + self.release = '3.3.7' | |
| 12 | + self.base_url = 'https://getbootstrap.com/' | |
| 13 | + self.root_path = 'getting-started' | |
| 14 | + self.links = { | |
| 15 | + home: 'https://getbootstrap.com/', | |
| 16 | + code: 'https://github.com/twbs/bootstrap' | |
| 17 | + } | |
| 18 | + | |
| 19 | + html_filters.push 'bootstrap/entries_v3', 'bootstrap/clean_html_v3' | |
| 20 | + | |
| 21 | + options[:trailing_slash] = false | |
| 22 | + options[:only] = %w(getting-started css components javascript) | |
| 23 | + end | |
| 24 | + | |
| 25 | + private | |
| 26 | + | |
| 27 | + def handle_response(response) | |
| 28 | + response.effective_url.scheme = 'https' | |
| 29 | + response.effective_url.path = response.effective_url.path.remove(/\/\z/) | |
| 30 | + super | |
| 31 | + end | |
| 32 | + end | |
| 33 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://raw.githubusercontent.com/twbs/bootstrap/master/docs/favicon.ico | |