ソースを参照

Update React documentation (19)

Simon Legner 1 年間 前
コミット
7d2643260d
1 ファイル変更14 行追加11 行削除
  1. 14 11
      lib/docs/scrapers/react.rb

+ 14 - 11
lib/docs/scrapers/react.rb

@@ -8,19 +8,27 @@ module Docs
       code: 'https://github.com/facebook/react'
     }
 
+    options[:attribution] = <<-HTML
+      &copy; 2013&ndash;present Facebook Inc.<br>
+      Licensed under the Creative Commons Attribution 4.0 International Public License.
+    HTML
+
     version do
-      self.release = '18.3.1'
+      self.release = '19'
       self.base_url = 'https://react.dev'
       self.initial_paths = %w(/reference/react /learn)
-
       html_filters.push 'react/entries_react_dev', 'react/clean_html_react_dev'
 
       options[:only_patterns] = [/\A\/learn/, /\A\/reference/]
+    end
+
+    version '18' do
+      self.release = '18.3.1'
+      self.base_url = 'https://18.react.dev'
+      self.initial_paths = %w(/reference/react /learn)
+      html_filters.push 'react/entries_react_dev', 'react/clean_html_react_dev'
 
-      options[:attribution] = <<-HTML
-        &copy; 2013&ndash;present Facebook Inc.<br>
-        Licensed under the Creative Commons Attribution 4.0 International Public License.
-      HTML
+      options[:only_patterns] = [/\A\/learn/, /\A\/reference/]
     end
 
     version '17' do
@@ -42,11 +50,6 @@ module Docs
         'working-with-the-browser.html' => 'refs-and-the-dom.html',
         'top-level-api.html' => 'react-api.html',
       }
-
-      options[:attribution] = <<-HTML
-        &copy; 2013&ndash;present Facebook Inc.<br>
-        Licensed under the Creative Commons Attribution 4.0 International Public License.
-      HTML
     end
 
     def get_latest_version(opts)