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
11
11
css ( '.start-footer' ) . remove
12
12
css ( '.footer' ) . remove
13
13
css ( '.end-footer' ) . remove
14
+ css ( '.statcounter' ) . remove
14
15
css ( 'form[action="https://www.google.com/search"]' ) . remove
15
16
doc
16
17
end
Original file line number Diff line number Diff line change @@ -2,24 +2,27 @@ module Docs
2
2
class Man
3
3
class EntriesFilter < Docs ::EntriesFilter
4
4
5
+ @@TYPES = { }
6
+
5
7
def get_name
8
+ return slug . split ( '/' ) . last . sub ( /\. (\d [^.]*)\z / , ' (\1)' ) if slug . start_with? ( 'man' )
6
9
at_css ( 'h1' ) . content . sub ( ' — Linux manual page' , '' )
7
10
end
8
11
9
12
def get_type
10
- 'Linux manual page'
13
+ build_types if slug == 'dir_by_project'
14
+ @@TYPES [ slug ] or 'Linux manual page'
11
15
end
12
16
13
- def entries
14
- return super unless slug == 'dir_by_project'
17
+ def build_types
15
18
type0 = nil
16
- return css ( '*' ) . each_with_object [ ] do |node , entries |
19
+ css ( '*' ) . each do |node |
17
20
if node . name == 'h2'
18
21
type0 = node . content
19
22
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
23
26
end
24
27
end
25
28
end
You can’t perform that action at this time.
0 commit comments