@@ -2,37 +2,40 @@ module Docs
2
2
class React < UrlScraper
3
3
self . name = 'React'
4
4
self . type = 'simple'
5
- self . release = '18.2.0'
6
- self . base_url = 'https://reactjs.org/docs/'
7
- self . root_path = 'hello-world.html'
8
5
self . links = {
9
- home : 'https://reactjs.org /' ,
6
+ home : 'https://react.dev /' ,
10
7
code : 'https://github.com/facebook/react'
11
8
}
12
9
13
- html_filters . push 'react/entries' , 'react/clean_html'
10
+ version '17' do
11
+ self . release = '17.0.2'
12
+ self . base_url = 'https://17.reactjs.org/docs/'
13
+ self . root_path = 'hello-world.html'
14
+ html_filters . push 'react/entries' , 'react/clean_html'
14
15
15
- options [ :skip ] = %w(
16
- codebase-overview.html
17
- design-principles.html
18
- how-to-contribute.html
19
- implementation-notes.html
20
- )
16
+ options [ :skip ] = %w(
17
+ codebase-overview.html
18
+ design-principles.html
19
+ how-to-contribute.html
20
+ implementation-notes.html
21
+ )
21
22
22
- options [ :replace_paths ] = {
23
- 'more-about-refs.html' => 'refs-and-the-dom.html' ,
24
- 'interactivity-and-dynamic-uis.html' => 'state-and-lifecycle.html' ,
25
- 'working-with-the-browser.html' => 'refs-and-the-dom.html' ,
26
- 'top-level-api.html' => 'react-api.html' ,
27
- }
23
+ options [ :replace_paths ] = {
24
+ 'more-about-refs.html' => 'refs-and-the-dom.html' ,
25
+ 'interactivity-and-dynamic-uis.html' => 'state-and-lifecycle.html' ,
26
+ 'working-with-the-browser.html' => 'refs-and-the-dom.html' ,
27
+ 'top-level-api.html' => 'react-api.html' ,
28
+ }
29
+
30
+ options [ :attribution ] = <<-HTML
31
+ © 2013–present Facebook Inc.< br >
32
+ Licensed under the Creative Commons Attribution 4.0 International Public License.
33
+ HTML
34
+ end
28
35
29
- options [ :attribution ] = <<-HTML
30
- © 2013–present Facebook Inc.< br >
31
- Licensed under the Creative Commons Attribution 4.0 International Public License.
32
- HTML
33
36
34
37
def get_latest_version ( opts )
35
- doc = fetch_doc ( 'https://reactjs.org/docs/getting-started.html ' , opts )
38
+ doc = fetch_doc ( 'https://react.dev/ ' , opts )
36
39
doc . at_css ( 'a[href="/versions"]' ) . content . strip [ 1 ..-1 ]
37
40
end
38
41
end
0 commit comments