Skip to content

Commit 6f1a9aa

Browse files
committed
Added Documentation for React-bootstrap
1 parent 38e0724 commit 6f1a9aa

6 files changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
&copy; 2014&ndash;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
642 Bytes
Loading
1.41 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://github.com/react-bootstrap/react-bootstrap/blob/master/www/static/logo.svg

0 commit comments

Comments
 (0)