Unified · Split
| @@ -0,0 +1,17 @@ | |||
| 1 | module Docs | ||
| 2 | class ReactBootstrap | ||
| 3 | class CleanHtmlFilter < Filter | ||
| 4 | def call | ||
| 5 | css('.flex-column.d-flex').remove | ||
| 6 | css('header').remove | ||
| 7 | css('.bs-example').remove | ||
| 8 | css('.position-relative').each do |node| | ||
| 9 | code = node.at_css('textarea') | ||
| 10 | code.name = 'pre' | ||
| 11 | code['style'] = code['style'] + '; border: solid 1px;' | ||
| 12 | end | ||
| 13 | doc | ||
| 14 | end | ||
| 15 | end | ||
| 16 | end | ||
| 17 | end | ||
| @@ -0,0 +1,23 @@ | |||
| 1 | module Docs | ||
| 2 | class ReactBootstrap | ||
| 3 | class EntriesFilter < Docs::EntriesFilter | ||
| 4 | def get_name | ||
| 5 | name = at_css('#rb-docs-content h1, #rb-docs-content h2').content | ||
| 6 | if name.end_with? '#' | ||
| 7 | name = name[0..-2] | ||
| 8 | end | ||
| 9 | name | ||
| 10 | end | ||
| 11 | |||
| 12 | def get_type | ||
| 13 | type = slug.split('/')[0..-2].join(': ') | ||
| 14 | if type == '' | ||
| 15 | type = slug.split('/').join('') | ||
| 16 | end | ||
| 17 | type.gsub!('-', ' ') | ||
| 18 | type.split.map(&:capitalize).join(' ') | ||
| 19 | type | ||
| 20 | end | ||
| 21 | end | ||
| 22 | end | ||
| 23 | end | ||
| @@ -0,0 +1,34 @@ | |||
| 1 | module Docs | ||
| 2 | class ReactBootstrap < UrlScraper | ||
| 3 | self.slug = 'react_bootstrap' | ||
| 4 | self.type = 'simple' | ||
| 5 | self.release = '1.5.0' | ||
| 6 | self.base_url = 'https://react-bootstrap.github.io/' | ||
| 7 | |||
| 8 | self.links = { | ||
| 9 | home: 'https://react-bootstrap.github.io', | ||
| 10 | code: 'https://github.com/react-bootstrap/react-bootstrap' | ||
| 11 | } | ||
| 12 | |||
| 13 | html_filters.push 'react_bootstrap/entries', 'react_bootstrap/clean_html' | ||
| 14 | |||
| 15 | options[:skip] = %w( | ||
| 16 | react-overlays/ | ||
| 17 | ) | ||
| 18 | |||
| 19 | options[:replace_paths] = { | ||
| 20 | } | ||
| 21 | |||
| 22 | options[:trailing_slash] = true | ||
| 23 | |||
| 24 | options[:attribution] = <<-HTML | ||
| 25 | © 2014–present Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff<br> | ||
| 26 | Licensed under the MIT License (MIT). | ||
| 27 | HTML | ||
| 28 | |||
| 29 | def get_latest_version(opts) | ||
| 30 | doc = fetch_doc('https://react-bootstrap.github.io/', opts) | ||
| 31 | doc.at_css('#t-version>a').content.split()[0].strip[1..-1] | ||
| 32 | end | ||
| 33 | end | ||
| 34 | end | ||
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | |||
| 1 | https://github.com/react-bootstrap/react-bootstrap/blob/master/www/static/logo.svg | ||