History

Added Documentation for React-bootstrap

dohsimpson committed 5 years ago

Commit 6f1a9aa1 parent 38e07246 files · +73 −-2Browse files

Unified · Split

6 files
  1. lib/docs/filters/react_bootstrap/clean_html.rb +17 −0
  2. lib/docs/filters/react_bootstrap/entries.rb +23 −0
  3. lib/docs/scrapers/react_bootstrap.rb +34 −0
  4. public/icons/docs/react_bootstrap/16.png +0 −0
  5. public/icons/docs/react_bootstrap/16@2x.png +0 −0
  6. public/icons/docs/react_bootstrap/SOURCE +1 −0
lib/docs/filters/react_bootstrap/clean_html.rb+17−0
@@ -0,0 +1,17 @@
1module 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
17end
lib/docs/filters/react_bootstrap/entries.rb+23−0
@@ -0,0 +1,23 @@
1module 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
23end
lib/docs/scrapers/react_bootstrap.rb+34−0
@@ -0,0 +1,34 @@
1module 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
34end
public/icons/docs/react_bootstrap/16.png+0−0

Binary file not shown.

public/icons/docs/react_bootstrap/16@2x.png+0−0

Binary file not shown.

public/icons/docs/react_bootstrap/SOURCE+1−0
@@ -0,0 +1 @@
1https://github.com/react-bootstrap/react-bootstrap/blob/master/www/static/logo.svg

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t