Showing the changes to lib/docs (2 of 10 files). Show all
Unified · Split
| @@ -1,16 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Bottle |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | − TYPES = { | |
| 5 | − 'routing' => 'Request Routing', | |
| 6 | − 'stpl' => 'SimpleTemplate Engine', | |
| 7 | − 'api' => 'API Reference', | |
| 8 | − | |
| 9 | − 'tutorial_app' => 'Tutorial', | |
| 10 | − 'async' => 'Primer to Asynchronous Applications', | |
| 11 | − 'faq' => 'Frequently Asked Questions' | |
| 12 | − } | |
| 13 | − | |
| 14 | 4 | def get_name |
| 15 | 5 | name = at_css('h1').content.strip |
| 16 | 6 | name.remove! "\u{00B6}" |
| @@ -18,15 +8,18 @@ module Docs · 1 unmodified line | ||
| 18 | 8 | end |
| 19 | 9 | |
| 20 | 10 | def get_type |
| 21 | − type = slug.split('/').first | |
| 22 | − | |
| 23 | − if TYPES.key?(type) | |
| 24 | − type = TYPES[type] | |
| 11 | + case slug | |
| 12 | + when 'api' | |
| 13 | + 'Reference' | |
| 14 | + when 'configuration' | |
| 15 | + 'Reference: Configuration' | |
| 16 | + when 'stpl' | |
| 17 | + 'Reference: SimpleTemplate' | |
| 18 | + when 'plugindev' | |
| 19 | + 'Reference: Plugin' | |
| 25 | 20 | else |
| 26 | − type = type.capitalize | |
| 21 | + 'Manual' | |
| 27 | 22 | end |
| 28 | − | |
| 29 | − type | |
| 30 | 23 | end |
| 31 | 24 | |
| 32 | 25 | def additional_entries |
| @@ -1,8 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | − class Bottle < FileScraper | |
| 2 | + class Bottle < UrlScraper | |
| 3 | 3 | self.type = 'sphinx' |
| 4 | − self.dir = "" | |
| 5 | − self.root_path = "index.html" | |
| 4 | + self.root_path = 'index.html' | |
| 6 | 5 | self.links = { |
| 7 | 6 | home: 'https://bottle.org/', |
| 8 | 7 | code: 'https://github.com/bottlepy/bottle' |
| @@ -12,24 +11,19 @@ module Docs · 3 unmodified lines | ||
| 12 | 11 | |
| 13 | 12 | options[:container] = '.body' |
| 14 | 13 | |
| 15 | − options[:skip] = %w( | |
| 16 | − changelog.html | |
| 17 | − development.html | |
| 18 | − plugindev.html | |
| 19 | − _modules/bottle.html | |
| 20 | − ) | |
| 14 | + options[:skip] = %w(changelog.html development.html _modules/bottle.html) | |
| 21 | 15 | |
| 22 | 16 | options[:attribution] = <<-HTML |
| 23 | − © 2009–2016, Marcel Hellkamp<br> | |
| 24 | − Licensed under the MIT License.<br> | |
| 17 | + © 2016 Marcel Hellkamp<br> | |
| 18 | + Licensed under the MIT License. | |
| 25 | 19 | HTML |
| 26 | 20 | |
| 27 | − version '0.12' do # http://bottlepy.org/docs/0.12/bottle-docs.zip | |
| 21 | + version '0.12' do | |
| 28 | 22 | self.release = '0.12' |
| 29 | 23 | self.base_url = "http://bottlepy.org/docs/#{self.version}/" |
| 30 | 24 | end |
| 31 | 25 | |
| 32 | − version '0.11' do # http://bottlepy.org/docs/0.11/bottle-docs.zip | |
| 26 | + version '0.11' do | |
| 33 | 27 | self.release = '0.11' |
| 34 | 28 | self.base_url = "http://bottlepy.org/docs/#{self.version}/" |
| 35 | 29 | end |