File tree 3 files changed +13
-13
lines changed
3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module Docs
2
2
class Prettier
3
3
class CleanHtmlFilter < Filter
4
4
def call
5
- @doc = at_css ( '.post ' )
5
+ @doc = at_css ( 'article .markdown ' )
6
6
7
7
if root_page?
8
8
at_css ( 'h1' ) . content = 'React Native Documentation'
@@ -34,10 +34,12 @@ def call
34
34
node . replace ( node . at_css ( 'pre.highlight' ) )
35
35
end
36
36
37
- css ( '.prism' ) . each do |node |
37
+ css ( '.prism-code ' ) . each do |node |
38
38
node . name = 'pre'
39
39
node [ 'data-language' ] = node [ 'class' ] [ /(?<=language\- )(\w +)/ ]
40
- node . content = node . content
40
+ node . content = node . css ( '.token-line' ) . map ( &:content ) . join ( "\n " )
41
+ node . remove_attribute ( 'class' )
42
+ node . remove_attribute ( 'style' )
41
43
end
42
44
43
45
css ( 'pre > code.hljs' ) . each do |node |
Original file line number Diff line number Diff line change @@ -6,19 +6,18 @@ def get_name
6
6
end
7
7
8
8
def type
9
- link = at_css ( '.navListItemActive ' )
10
- section = link . ancestors ( '.navGroup ' ) . first
11
- type = section . at_css ( 'h3 ' ) . content . strip
9
+ link = at_css ( '.menu__link--active ' )
10
+ section = link . ancestors ( '.theme-doc-sidebar-item-category-level-1 ' ) . first
11
+ type = section . at_css ( '.menu__link--sublist ' ) . content . strip
12
12
return name if type == 'Configuring Prettier'
13
13
return name if type == 'Usage'
14
14
type
15
15
end
16
16
17
17
def additional_entries
18
18
entries = [ ]
19
- css ( '.mainContainer h2' ) . each do |node |
20
- id = node . at_css ( '.anchor' ) [ 'id' ]
21
- entries << [ node . text , id ]
19
+ css ( 'h2' ) . each do |node |
20
+ entries << [ node . text , node [ 'id' ] ]
22
21
end
23
22
entries
24
23
end
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ module Docs
2
2
class Prettier < UrlScraper
3
3
self . name = 'Prettier'
4
4
self . type = 'simple'
5
- self . release = '3.4.2 '
6
- self . base_url = 'https://prettier.io/docs/en/ '
5
+ self . release = '3.5.3 '
6
+ self . base_url = 'https://prettier.io/docs/'
7
7
self . links = {
8
8
home : 'https://prettier.io/' ,
9
9
code : 'https://github.com/prettier/prettier'
@@ -12,11 +12,10 @@ class Prettier < UrlScraper
12
12
# Docusaurus like react_native
13
13
html_filters . push 'prettier/entries' , 'prettier/clean_html'
14
14
15
- options [ :container ] = '.docMainWrapper'
16
-
17
15
options [ :attribution ] = <<-HTML
18
16
© James Long and contributors
19
17
HTML
18
+ options [ :skip_patterns ] = [ /^next/ ]
20
19
21
20
def get_latest_version ( opts )
22
21
get_npm_version ( 'prettier' , opts )
You can’t perform that action at this time.
0 commit comments