File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ module Docs
22 class SaltStack
33 class CleanHtmlFilter < Filter
44 def call
5+ css ( '.headerlink' ) . remove
6+
57 doc
68 end
79 end
Original file line number Diff line number Diff line change 11module Docs
22 class SaltStack
33 class EntriesFilter < Docs ::EntriesFilter
4+ SALT_REF_RGX = /salt\. ([^\. ]+)\. ([^\s ]+)/
5+
46 def get_name
5- at_css ( 'h1' ) . content
7+ header = at_css ( 'h1' ) . content
8+
9+ ref_match = SALT_REF_RGX . match ( header )
10+ if ref_match
11+ ns , mod = ref_match . captures
12+ "#{ ns } .#{ mod } "
13+ else
14+ header
15+ end
616 end
717
818 def get_type
9- 'TODO'
19+ type , _ = slug . split ( '/' , 2 )
20+ type
21+ end
22+
23+ def include_default_entry?
24+ !subpath . end_with? ( 'index.html' )
1025 end
1126 end
1227 end
Original file line number Diff line number Diff line change 11module Docs
22 class SaltStack < UrlScraper
3+ self . type = 'salt_stack'
34 self . release = '2018.3.2'
45 self . base_url = 'https://docs.saltstack.com/en/latest/ref/'
56
6- html_filters . push 'salt_stack/entries' , 'salt_stack/clean_html'
7+ html_filters . push 'salt_stack/clean_html' , 'salt_stack/entries'
8+
9+ options [ :only_patterns ] = [
10+ %r{[^/]+/all/}
11+ ]
712
813 options [ :container ] = '.body-content'
914
You can’t perform that action at this time.
0 commit comments