|
1 | 1 | module Docs |
2 | | - class SaltStack < UrlScraper |
3 | | - self.type = 'salt_stack' |
4 | | - self.release = '2018.3.2' |
5 | | - self.base_url = 'https://docs.saltstack.com/en/latest/ref/' |
| 2 | + # The official documentation website is heavily rate-limited |
| 3 | + # |
| 4 | + # The documentation can be generated like this (replace 2019.2 with the correct tag): |
| 5 | + # $ git clone https://github.com/saltstack/salt.git --branch 2019.2 --depth 1 |
| 6 | + # $ cd salt/doc |
| 7 | + # $ pip install sphinx |
| 8 | + # $ make html |
| 9 | + # |
| 10 | + # The generated html can be found in salt/doc/_build/html |
| 11 | + class SaltStack < FileScraper |
| 12 | + self.type = 'simple' |
| 13 | + self.slug = 'salt_stack' |
| 14 | + self.release = '2019.2.0' |
| 15 | + self.base_url = 'https://docs.saltstack.com/en/latest/' |
| 16 | + self.root_path = 'ref/index.html' |
6 | 17 | self.links = { |
7 | 18 | home: 'https://www.saltstack.com/', |
8 | 19 | code: 'https://github.com/saltstack/salt' |
9 | 20 | } |
10 | 21 |
|
11 | 22 | html_filters.push 'salt_stack/clean_html', 'salt_stack/entries' |
12 | 23 |
|
13 | | - options[:only_patterns] = [ |
14 | | - %r{^[^/]+/all/} |
15 | | - ] |
16 | | - |
17 | | - options[:container] = '.body-content' |
| 24 | + options[:only_patterns] = [/all\//] |
| 25 | + options[:container] = '.body-content > .section' |
18 | 26 |
|
19 | 27 | options[:attribution] = <<-HTML |
20 | | - © 2018 SaltStack.<br> |
| 28 | + © 2019 SaltStack.<br> |
21 | 29 | Licensed under the Apache License, Version 2.0. |
22 | 30 | HTML |
| 31 | + |
| 32 | + def get_latest_version(opts) |
| 33 | + get_latest_github_release('saltstack', 'salt', opts) |
| 34 | + end |
23 | 35 | end |
24 | 36 | end |
0 commit comments