@@ -3,16 +3,13 @@ class VueRouter
33 class EntriesFilter < Docs ::EntriesFilter
44 def get_name
55 name = at_css ( 'h1' ) . content
6-
76 name . remove! '# '
8-
97 name
108 end
119
1210 def get_type
1311 return 'Other Guides' if subpath . start_with? ( 'guide/advanced' )
1412 return 'Basic Guides' if subpath . start_with? ( 'guide' ) || subpath . start_with? ( 'installation' )
15-
1613 'API Reference'
1714 end
1815
@@ -21,7 +18,7 @@ def include_default_entry?
2118 end
2219
2320 def additional_entries
24- return [ ] unless subpath . start_with? ( 'api' )
21+ return [ ] unless subpath . start_with? ( 'api' )
2522
2623 entries = [
2724 [ '<router-link>' , 'router-link' , 'API Reference' ] ,
@@ -31,41 +28,44 @@ def additional_entries
3128 ]
3229
3330 css ( 'h3' ) . each do |node |
34- entryName = node . content . strip
31+ entry_name = node . content . strip
3532
3633 # Get the previous h2 title
3734 title = node
3835 title = title . previous_element until title . name == 'h2'
3936 title = title . content . strip
4037 title . remove! '# '
4138
42- entryName . remove! '# '
39+ entry_name . remove! '# '
4340
44- if title == "Router Construction Options"
45- entryName = "RouterOptions.#{ entryName } "
46- elsif title == "<router-view> Props"
47- entryName = "<router-view> `#{ entryName } ` prop"
48- elsif title == "<router-link> Props"
49- entryName = "<router-link> `#{ entryName } ` prop"
50- elsif title == "Router Instance Methods"
51- entryName = "#{ entryName } ()"
41+ case title
42+ when 'Router Construction Options'
43+ entry_name = "RouterOptions.#{ entry_name } "
44+ when '<router-view> Props'
45+ entry_name = "<router-view> `#{ entry_name } ` prop"
46+ when '<router-link> Props'
47+ entry_name = "<router-link> `#{ entry_name } ` prop"
48+ when 'Router Instance Methods'
49+ entry_name = "#{ entry_name } ()"
5250 end
5351
54- unless title == "Component Injections" || node [ 'id' ] == 'applying-active-class-to-outer-element' || node [ 'id' ] == 'route-object-properties'
55- entries << [ entryName , node [ 'id' ] , 'API Reference' ]
52+ entry_name = entry_name . split ( ' API ' ) [ 0 ] if entry_name . start_with? ( 'v-slot' )
53+
54+ unless title == "Component Injections" || node [ 'id' ] == 'route-object-properties'
55+ entries << [ entry_name , node [ 'id' ] , 'API Reference' ]
5656 end
5757 end
5858
5959 css ( '#route-object-properties + ul > li > p:first-child > strong' ) . each do |node |
60- entryName = node . content . strip
61- id = "route-object-#{ entryName . remove ( '$route.' ) } "
60+ entry_name = node . content . strip
61+ id = "route-object-#{ entry_name . remove ( '$route.' ) } "
6262
6363 node [ 'id' ] = id
64- entries << [ entryName , node [ 'id' ] , 'API Reference' ]
64+ entries << [ entry_name , node [ 'id' ] , 'API Reference' ]
6565 end
6666
6767 entries
6868 end
6969 end
7070 end
71- end
71+ end
0 commit comments