mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
parent
e2a26c3638
commit
660cb1e5fd
2 changed files with 6 additions and 7 deletions
|
@ -16,7 +16,10 @@ module Docs
|
|||
def get_name
|
||||
name = at_css('h1').content
|
||||
name.remove! %r{\A[\d\.]+ } # remove list number
|
||||
name.remove! "\u{00B6}" # remove pilcrow sign
|
||||
name.remove! %r{ [\u{2013}\u{2014}].+\z} # remove text after em/en dash
|
||||
name.remove! 'Built-in'
|
||||
name.strip!
|
||||
name
|
||||
end
|
||||
|
||||
|
@ -42,11 +45,11 @@ module Docs
|
|||
end
|
||||
|
||||
def include_default_entry?
|
||||
name !~ /[A-Z]/ && !skip? # skip non-module names
|
||||
!at_css('.body > .section:only-child > .toctree-wrapper:last-child') && !type.in?(%w(Language Superseded))
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] if root_page? || skip? || name == 'errno'
|
||||
return [] if root_page? || !include_default_entry? || name == 'errno'
|
||||
clean_id_attributes
|
||||
entries = []
|
||||
|
||||
|
@ -67,10 +70,6 @@ module Docs
|
|||
entries
|
||||
end
|
||||
|
||||
def skip?
|
||||
type == 'Language'
|
||||
end
|
||||
|
||||
def clean_id_attributes
|
||||
css('.section > .target[id]').each do |node|
|
||||
if dt = node.at_css('+ dl > dt')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Docs
|
||||
class Python < FileScraper
|
||||
self.version = '3.4.0'
|
||||
self.version = '3.4.2'
|
||||
self.type = 'sphinx'
|
||||
self.dir = '/Users/Thibaut/DevDocs/Docs/Python' # downloaded from docs.python.org/3/download.html
|
||||
self.base_url = 'http://docs.python.org/3/'
|
||||
|
|
Loading…
Reference in a new issue