History

Improve React scraper

Thibaut committed 11 years ago

Commit d96ce261 parent e096acc2 files · +13 −11Browse files

Unified · Split

2 files
  1. lib/docs/filters/react/entries.rb +3 −3
  2. lib/docs/scrapers/react.rb +10 −8
lib/docs/filters/react/entries.rb+3−3
@@ -2,9 +2,9 @@ module Docs · 1 unmodified line
22 class React
33 class EntriesFilter < Docs::EntriesFilter
44 API_SLUGS = %w(
5− top-level-api
6− component-api
7− component-specs
5+ docs/top-level-api
6+ docs/component-api
7+ docs/component-specs
88 )
99
1010 def get_name
lib/docs/scrapers/react.rb+10−8
@@ -3,22 +3,24 @@ module Docs · 2 unmodified lines
33 self.name = 'React'
44 self.type = 'react'
55 self.version = '0.13.3'
6− self.base_url = 'http://facebook.github.io/react/docs/'
7− self.root_path = 'getting-started.html'
6+ self.base_url = 'https://facebook.github.io/react/'
7+ self.root_path = 'docs/getting-started.html'
88 self.links = {
9− home: 'http://facebook.github.io/react/',
9+ home: 'https://facebook.github.io/react/',
1010 code: 'https://github.com/facebook/react'
1111 }
1212
1313 html_filters.push 'react/entries', 'react/clean_html'
1414
1515 options[:container] = '.documentationContent'
16−
16+ options[:only_patterns] = [/\Adocs\//, /\Atips\//]
1717 options[:skip] = %w(
18− videos.html
19− complementary-tools.html
20− examples.html
21− conferences.html)
18+ docs/
19+ docs/videos.html
20+ docs/complementary-tools.html
21+ docs/examples.html
22+ docs/conferences.html
23+ tips/introduction.html)
2224
2325 options[:attribution] = <<-HTML
2426 &copy; 2013&ndash;2015 Facebook Inc.<br>