Skip to content

Commit 9d60cc8

Browse files
committed
Add basic scraper and friends that doesn't blow up
1 parent 24abe4c commit 9d60cc8

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module Docs
2+
class SaltStack
3+
class CleanHtmlFilter < Filter
4+
def call
5+
doc
6+
end
7+
end
8+
end
9+
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module Docs
2+
class SaltStack
3+
class EntriesFilter < Docs::EntriesFilter
4+
def get_name
5+
at_css('h1').content
6+
end
7+
8+
def get_type
9+
'TODO'
10+
end
11+
end
12+
end
13+
end

lib/docs/scrapers/salt_stack.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Docs
2+
class SaltStack < UrlScraper
3+
self.release = '2018.3.2'
4+
self.base_url = 'https://docs.saltstack.com/en/latest/ref/'
5+
6+
html_filters.push 'salt_stack/entries', 'salt_stack/clean_html'
7+
8+
options[:container] = '.body-content'
9+
10+
options[:attribution] = <<-HTML
11+
&copy; 2018 SaltStack. All Rights Reserved, SaltStack Inc.
12+
HTML
13+
end
14+
end

0 commit comments

Comments
 (0)