History

Finish Bottle scraper

Thibaut Courouble committed 10 years ago

Commit 380afc41 parent 45e68b010 files · +24 −26Browse files

Unified · Split

10 files
  1. assets/images/docs.png +0 −0
  2. assets/images/docs@2x.png +0 −0
  3. assets/javascripts/news.json +3 −0
  4. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  5. assets/stylesheets/global/_icons.scss +1 −0
  6. lib/docs/filters/bottle/entries.rb +10 −17
  7. lib/docs/scrapers/bottle.rb +7 −13
  8. public/icons/docs/bottle/16.png +0 −0
  9. public/icons/docs/bottle/16@2x.png +0 −0
  10. public/icons/docs/bottle/SOURCE +2 −0
assets/images/docs.png+0−0

Binary file not shown.

assets/images/docs@2x.png+0−0

Binary file not shown.

assets/javascripts/news.json+3−0
@@ -1,5 +1,8 @@
11 [
22 [
3+ "2016-09-05",
4+ "New documentation: <a href=\"/bottle/\">Bottle</a>"
5+ ], [
36 "2016-08-07",
47 "New documentation: <a href=\"/docker/\">Docker</a>"
58 ], [
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -109,6 +109,11 @@ credits = [ · 108 unmodified lines
109109 '2011-2016 Twitter, Inc.',
110110 'CC BY',
111111 'https://creativecommons.org/licenses/by/3.0/'
112+ ], [
113+ 'Bottle',
114+ '2016 Marcel Hellkamp',
115+ 'MIT',
116+ 'https://raw.githubusercontent.com/bottlepy/bottle/master/LICENSE'
112117 ], [
113118 'Bower',
114119 '2016 Bower contributors',
assets/stylesheets/global/_icons.scss+1−0
@@ -116,6 +116,7 @@ · 115 unmodified lines
116116 ._icon-socketio:before { background-position: -2rem -6rem; }
117117 ._icon-modernizr:before { background-position: -3rem -6rem; }
118118 ._icon-bower:before { background-position: -4rem -6rem; }
119+._icon-bottle:before { background-position: 0 -7rem; }
119120 ._icon-docker:before { background-position: -1rem -7rem; }
120121 ._icon-cakephp:before { background-position: -2rem -7rem; }
121122 ._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; }
lib/docs/filters/bottle/entries.rb+10−17
@@ -1,16 +1,6 @@
11 module Docs
22 class Bottle
33 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−
144 def get_name
155 name = at_css('h1').content.strip
166 name.remove! "\u{00B6}"
@@ -18,15 +8,18 @@ module Docs · 1 unmodified line
188 end
199
2010 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'
2520 else
26− type = type.capitalize
21+ 'Manual'
2722 end
28−
29− type
3023 end
3124
3225 def additional_entries
lib/docs/scrapers/bottle.rb+7−13
@@ -1,8 +1,7 @@
11 module Docs
2− class Bottle < FileScraper
2+ class Bottle < UrlScraper
33 self.type = 'sphinx'
4− self.dir = ""
5− self.root_path = "index.html"
4+ self.root_path = 'index.html'
65 self.links = {
76 home: 'https://bottle.org/',
87 code: 'https://github.com/bottlepy/bottle'
@@ -12,24 +11,19 @@ module Docs · 3 unmodified lines
1211
1312 options[:container] = '.body'
1413
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)
2115
2216 options[:attribution] = <<-HTML
23− &copy; 2009&ndash;2016, Marcel Hellkamp<br>
24− Licensed under the MIT License.<br>
17+ &copy; 2016 Marcel Hellkamp<br>
18+ Licensed under the MIT License.
2519 HTML
2620
27− version '0.12' do # http://bottlepy.org/docs/0.12/bottle-docs.zip
21+ version '0.12' do
2822 self.release = '0.12'
2923 self.base_url = "http://bottlepy.org/docs/#{self.version}/"
3024 end
3125
32− version '0.11' do # http://bottlepy.org/docs/0.11/bottle-docs.zip
26+ version '0.11' do
3327 self.release = '0.11'
3428 self.base_url = "http://bottlepy.org/docs/#{self.version}/"
3529 end
public/icons/docs/bottle/16.png+0−0

Binary file not shown.

public/icons/docs/bottle/16@2x.png+0−0

Binary file not shown.

public/icons/docs/bottle/SOURCE+2−0
@@ -0,0 +1,2 @@
1+https://raw.githubusercontent.com/bottlepy/bottlepy.org/master/sphinx/static/logo_icon.png
2+https://github.com/bottlepy/bottle/issues/886