File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def get_name
1010 def get_type
1111 breadcrumb_nodes = css ( 'a.tracking-wide' )
1212 category = breadcrumb_nodes . last . content
13- is_learn_page = base_url . to_s . end_with ?( 'learn' )
13+ is_learn_page = path . start_with ?( 'learn/ ' )
1414 prefix = is_learn_page ? 'Learn: ' : ''
1515 return prefix + ( category || 'Miscellaneous' )
1616 end
Original file line number Diff line number Diff line change 11module Docs
22 class React < UrlScraper
3- include MultipleBaseUrls
43
54 self . name = 'React'
65 self . type = 'simple'
@@ -11,15 +10,13 @@ class React < UrlScraper
1110
1211 version do
1312 self . release = '18.3.1'
14- host = 'https://react.dev'
15- self . base_urls = [
16- "#{ host } /reference" ,
17- "#{ host } /learn" ,
18- ]
19- self . initial_paths = %w( /react )
13+ self . base_url = 'https://react.dev'
14+ self . initial_paths = %w( /reference/react /learn )
2015
2116 html_filters . push 'react/entries_react_dev' , 'react/clean_html_react_dev'
2217
18+ options [ :only_patterns ] = [ /\A \/ learn/ , /\A \/ reference/ ]
19+
2320 options [ :attribution ] = <<-HTML
2421 © 2013–present Facebook Inc.< br >
2522 Licensed under the Creative Commons Attribution 4.0 International Public License.
You can’t perform that action at this time.
0 commit comments