[devdocsgjs/main: 408/1867] Add basic scraper and friends that doesn't blow up
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 408/1867] Add basic scraper and friends that doesn't blow up
- Date: Fri, 19 Nov 2021 23:47:14 +0000 (UTC)
commit 9d60cc80f5cf0cc67b5153fe2a28dd217c47c43e
Author: Boris Bera <bera boris gmail com>
Date: Tue Sep 25 22:29:26 2018 -0400
Add basic scraper and friends that doesn't blow up
lib/docs/filters/salt_stack/clean_html.rb | 9 +++++++++
lib/docs/filters/salt_stack/entries.rb | 13 +++++++++++++
lib/docs/scrapers/salt_stack.rb | 14 ++++++++++++++
3 files changed, 36 insertions(+)
---
diff --git a/lib/docs/filters/salt_stack/clean_html.rb b/lib/docs/filters/salt_stack/clean_html.rb
new file mode 100644
index 00000000..ac53a94c
--- /dev/null
+++ b/lib/docs/filters/salt_stack/clean_html.rb
@@ -0,0 +1,9 @@
+module Docs
+ class SaltStack
+ class CleanHtmlFilter < Filter
+ def call
+ doc
+ end
+ end
+ end
+end
diff --git a/lib/docs/filters/salt_stack/entries.rb b/lib/docs/filters/salt_stack/entries.rb
new file mode 100644
index 00000000..dda9871d
--- /dev/null
+++ b/lib/docs/filters/salt_stack/entries.rb
@@ -0,0 +1,13 @@
+module Docs
+ class SaltStack
+ class EntriesFilter < Docs::EntriesFilter
+ def get_name
+ at_css('h1').content
+ end
+
+ def get_type
+ 'TODO'
+ end
+ end
+ end
+end
diff --git a/lib/docs/scrapers/salt_stack.rb b/lib/docs/scrapers/salt_stack.rb
new file mode 100644
index 00000000..3196a18a
--- /dev/null
+++ b/lib/docs/scrapers/salt_stack.rb
@@ -0,0 +1,14 @@
+module Docs
+ class SaltStack < UrlScraper
+ self.release = '2018.3.2'
+ self.base_url = 'https://docs.saltstack.com/en/latest/ref/'
+
+ html_filters.push 'salt_stack/entries', 'salt_stack/clean_html'
+
+ options[:container] = '.body-content'
+
+ options[:attribution] = <<-HTML
+ © 2018 SaltStack. All Rights Reserved, SaltStack Inc.
+ HTML
+ end
+end
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]