File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ def call
1111 css ( '.start-footer' ) . remove
1212 css ( '.footer' ) . remove
1313 css ( '.end-footer' ) . remove
14+ css ( '.statcounter' ) . remove
1415 css ( 'form[action="https://www.google.com/search"]' ) . remove
1516 doc
1617 end
Original file line number Diff line number Diff line change @@ -2,24 +2,27 @@ module Docs
22 class Man
33 class EntriesFilter < Docs ::EntriesFilter
44
5+ @@TYPES = { }
6+
57 def get_name
8+ return slug . split ( '/' ) . last . sub ( /\. (\d [^.]*)\z / , ' (\1)' ) if slug . start_with? ( 'man' )
69 at_css ( 'h1' ) . content . sub ( ' — Linux manual page' , '' )
710 end
811
912 def get_type
10- 'Linux manual page'
13+ build_types if slug == 'dir_by_project'
14+ @@TYPES [ slug ] or 'Linux manual page'
1115 end
1216
13- def entries
14- return super unless slug == 'dir_by_project'
17+ def build_types
1518 type0 = nil
16- return css ( '*' ) . each_with_object [ ] do |node , entries |
19+ css ( '*' ) . each do |node |
1720 if node . name == 'h2'
1821 type0 = node . content
1922 elsif node . name == 'a' and node [ 'href' ] and node [ 'href' ] . start_with? ( 'man' ) and type0
20- name = node . content + node . next_sibling . content
21- path = node [ 'href' ]
22- entries << Entry . new ( name , path , type0 )
23+ # name = node.content + node.next_sibling.content
24+ slug0 = node [ 'href' ] . remove ( / \. html \z / )
25+ @@TYPES [ slug0 ] = type0
2326 end
2427 end
2528 end
You can’t perform that action at this time.
0 commit comments