ソースを参照

Improve React scraper

Thibaut 10 年 前
コミット
d96ce26bb7
2 ファイル変更13 行追加11 行削除
  1. 3 3
      lib/docs/filters/react/entries.rb
  2. 10 8
      lib/docs/scrapers/react.rb

+ 3 - 3
lib/docs/filters/react/entries.rb

@@ -2,9 +2,9 @@ module Docs
   class React
     class EntriesFilter < Docs::EntriesFilter
       API_SLUGS = %w(
-        top-level-api
-        component-api
-        component-specs
+        docs/top-level-api
+        docs/component-api
+        docs/component-specs
       )
 
       def get_name

+ 10 - 8
lib/docs/scrapers/react.rb

@@ -3,22 +3,24 @@ module Docs
     self.name = 'React'
     self.type = 'react'
     self.version = '0.13.3'
-    self.base_url = 'http://facebook.github.io/react/docs/'
-    self.root_path = 'getting-started.html'
+    self.base_url = 'https://facebook.github.io/react/'
+    self.root_path = 'docs/getting-started.html'
     self.links = {
-      home: 'http://facebook.github.io/react/',
+      home: 'https://facebook.github.io/react/',
       code: 'https://github.com/facebook/react'
     }
 
     html_filters.push 'react/entries', 'react/clean_html'
 
     options[:container] = '.documentationContent'
-
+    options[:only_patterns] = [/\Adocs\//, /\Atips\//]
     options[:skip] = %w(
-      videos.html
-      complementary-tools.html
-      examples.html
-      conferences.html)
+      docs/
+      docs/videos.html
+      docs/complementary-tools.html
+      docs/examples.html
+      docs/conferences.html
+      tips/introduction.html)
 
     options[:attribution] = <<-HTML
       &copy; 2013&ndash;2015 Facebook Inc.<br>