Finish Falcon scraper

pull/574/merge
Thibaut Courouble 8 years ago
parent f424256f6c
commit 899aee8339

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@ -1,7 +1,7 @@
[ [
[ [
"2017-06-04", "2017-06-04",
"New documentations: <a href=\"/electron/\">Electron</a>, <a href=\"/pug/\">Pug</a>" "New documentations: <a href=\"/electron/\">Electron</a>, <a href=\"/pug/\">Pug</a>, and <a href=\"/falcon/\">Falcon</a>"
], [ ], [
"2017-05-14", "2017-05-14",
"New documentations: <a href=\"/jest/\">Jest</a>, <a href=\"/jasmine/\">Jasmine</a> and <a href=\"/liquid/\">Liquid</a>" "New documentations: <a href=\"/jest/\">Jest</a>, <a href=\"/jasmine/\">Jasmine</a> and <a href=\"/liquid/\">Liquid</a>"

@ -243,6 +243,11 @@ credits = [
'2016 StrongLoop, IBM, and other expressjs.com contributors.', '2016 StrongLoop, IBM, and other expressjs.com contributors.',
'CC BY-SA', 'CC BY-SA',
'https://raw.githubusercontent.com/expressjs/expressjs.com/gh-pages/LICENSE.md' 'https://raw.githubusercontent.com/expressjs/expressjs.com/gh-pages/LICENSE.md'
], [
'Falcon',
'2012-2016 by Rackspace Hosting, Inc. and other contributors',
'Apache',
'https://raw.githubusercontent.com/falconry/falcon/master/LICENSE'
], [ ], [
'Fish', 'Fish',
'2005-2009 Axel Liljencrantz', '2005-2009 Axel Liljencrantz',

@ -174,3 +174,4 @@
._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; } ._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; }
._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; } ._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; }
._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; } ._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; }
._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; }

@ -9,14 +9,10 @@ module Docs
def get_type def get_type
case slug.split('/').first case slug.split('/').first
when 'community'
'Community Guide'
when 'user' when 'user'
'User Guide' 'Guide'
when 'api' when 'api'
'Classes and Functions' 'API'
else
'Other'
end end
end end
@ -24,23 +20,33 @@ module Docs
entries = [] entries = []
css('.class').each do |node| css('.class').each do |node|
namespace = node.at_css('.descclassname').content.strip.remove(/\.\z/)
class_name = node.at_css('dt > .descname').content class_name = node.at_css('dt > .descname').content
class_id = node.at_css('dt[id]')['id'] class_id = node.at_css('dt[id]')['id']
entries << [class_name, class_id] entries << ["#{namespace}.#{class_name}", class_id, namespace]
node.css('.attribute').each do |n|
next unless n.at_css('dt[id]')
name = n.at_css('.descname').content
name = "#{namespace}.#{class_name}.#{name}"
id = n.at_css('dt[id]')['id']
entries << [name, id, namespace]
end
node.css('.method').each do |n| node.css('.method').each do |n|
next unless n.at_css('dt[id]') next unless n.at_css('dt[id]')
name = n.at_css('.descname').content name = n.at_css('.descname').content
name = "#{class_name}.#{name}()" name = "#{namespace}.#{class_name}.#{name}()"
id = n.at_css('dt[id]')['id'] id = n.at_css('dt[id]')['id']
entries << [name, id] entries << [name, id, namespace]
end end
end end
css('.function').each do |node| css('.function').each do |node|
name = "#{node.at_css('.descname').content}()" namespace = node.at_css('.descclassname').content.strip.remove(/\.\z/)
name = "#{namespace}.#{node.at_css('.descname').content}()"
id = node.at_css('dt[id]')['id'] id = node.at_css('dt[id]')['id']
entries << [name, id] entries << [name, id, namespace]
end end
entries entries

@ -11,17 +11,17 @@ module Docs
options[:container] = '.body' options[:container] = '.body'
options[:skip_patterns] = [/\Achanges/, /\A_modules/] options[:skip] = %w(user/index.html api/index.html)
options[:skip_patterns] = [/\Achanges/, /\A_modules/, /\Acommunity/]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2016 Falcon Contributors<br> &copy; 2012&ndash;2016 by Rackspace Hosting, Inc. and other contributors<br>
Licensed under the Apache 2 License. Licensed under the Apache License, Version 2.0.
HTML HTML
version '1.2.0' do version '1.2' do
self.release = '1.2.0' self.release = '1.2.0'
self.base_url = "https://falcon.readthedocs.io/en/#{self.version}/" self.base_url = "https://falcon.readthedocs.io/en/#{self.release}/"
end end
end end
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

@ -1 +1 @@
https://github.com/falconry/falcon/blob/master/docs/_static/img/logo.jpg https://github.com/falconry/falconry.github.io

Loading…
Cancel
Save