Unified · Split
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | 3 | "2022-08-27", |
| 4 | − "New documentations: <a href=\"/sanctuary/\">Sanctuary</a>" | |
| 4 | + "New documentations: <a href=\"/sanctuary/\">Sanctuary</a>, <a href=\"/requests/\">Requests</a>" | |
| 5 | 5 | ], |
| 6 | 6 | [ |
| 7 | 7 | "2022-05-03", |
| @@ -766,6 +766,11 @@ credits = [ · 765 unmodified lines | ||
| 766 | 766 | '2015-2022 Dan Abramov', |
| 767 | 767 | 'MIT', |
| 768 | 768 | 'https://raw.githubusercontent.com/reactjs/redux/master/LICENSE.md' |
| 769 | + ], [ | |
| 770 | + 'Requests', | |
| 771 | + '2011-2022 Kenneth Reitz and other contributors', | |
| 772 | + 'Apache', | |
| 773 | + 'https://raw.githubusercontent.com/psf/requests/main/LICENSE' | |
| 769 | 774 | ], [ |
| 770 | 775 | 'RequireJS', |
| 771 | 776 | 'jQuery Foundation and other contributors', |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | h4 { font-size: 1em; } |
| 5 | 5 | > dl:not(.docutils) > dt { @extend %block-label, %label-blue; } |
| 6 | 6 | dd > dl:not(.docutils) > dt { @extend %block-label; } |
| 7 | − .class > dt { @extend %block-label, %label-blue; } | |
| 7 | + .class > dt, #main-interface .function > dt { @extend %block-label, %label-blue; } | |
| 8 | 8 | dt + dt { margin-top: -.5em; } |
| 9 | 9 | |
| 10 | 10 | .note, .admonition, div.versionadded, div.versionchanged, .deprecated-removed, .deprecated, .topic { @extend %note; } |
| @@ -0,0 +1,75 @@ | ||
| 1 | +module Docs | |
| 2 | + class Requests | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + TYPE_BY_SLUG = {} | |
| 5 | + | |
| 6 | + def call | |
| 7 | + if root_page? | |
| 8 | + css('.section').each do |node| | |
| 9 | + type = node.at_css('h2').content[0..-2] | |
| 10 | + node.css('li > a').each do |n| | |
| 11 | + s = n['href'].split('/')[-2] | |
| 12 | + TYPE_BY_SLUG[s] = type | |
| 13 | + end | |
| 14 | + end | |
| 15 | + end | |
| 16 | + super | |
| 17 | + end | |
| 18 | + | |
| 19 | + def get_name | |
| 20 | + at_css('h1').content[0..-2] | |
| 21 | + end | |
| 22 | + | |
| 23 | + def get_type | |
| 24 | + TYPE_BY_SLUG[slug.split('/').first] || 'Other' | |
| 25 | + end | |
| 26 | + | |
| 27 | + def include_default_entry? | |
| 28 | + slug != 'api/' | |
| 29 | + end | |
| 30 | + | |
| 31 | + def additional_entries | |
| 32 | + entries = [] | |
| 33 | + css('dl.function > dt[id]').each do |node| | |
| 34 | + name = node['id'].split('.').last + '()' | |
| 35 | + id = node['id'] | |
| 36 | + type = node['id'].split('.')[0..-2].join('.') | |
| 37 | + entries << [name, id, type] | |
| 38 | + end | |
| 39 | + | |
| 40 | + css('dl.class > dt[id]').each do |node| | |
| 41 | + name = node['id'].split('.').last | |
| 42 | + id = node['id'] | |
| 43 | + type = node['id'].split('.')[0..-2].join('.') | |
| 44 | + entries << [name, id, type] | |
| 45 | + end | |
| 46 | + | |
| 47 | + css('dl.attribute > dt[id]').each do |node| | |
| 48 | + name = node['id'].split('.')[-2..-1].join('.') | |
| 49 | + id = node['id'] | |
| 50 | + type = node['id'].split('.')[0..-3].join('.') | |
| 51 | + type = 'requests' if type == '' | |
| 52 | + entries << [name, id, type] | |
| 53 | + end | |
| 54 | + | |
| 55 | + css('dl.data > dt[id]').each do |node| | |
| 56 | + name = node['id'] | |
| 57 | + id = node['id'] | |
| 58 | + type = node['id'].split('.')[0..-3].join('.') | |
| 59 | + type = 'requests' if type == '' | |
| 60 | + type = 'Configuration' if slug == 'config/' | |
| 61 | + entries << [name, id, type] | |
| 62 | + end | |
| 63 | + | |
| 64 | + css('dl.method > dt[id]').each do |node| | |
| 65 | + name = node['id'].split('.')[-2..-1].join('.') + '()' | |
| 66 | + id = node['id'] | |
| 67 | + type = node['id'].split('.')[0..-3].join('.') | |
| 68 | + entries << [name, id, type] | |
| 69 | + end | |
| 70 | + entries | |
| 71 | + end | |
| 72 | + | |
| 73 | + end | |
| 74 | + end | |
| 75 | +end | |
| @@ -60,6 +60,7 @@ module Docs · 59 unmodified lines | ||
| 60 | 60 | css('dt').each do |node| |
| 61 | 61 | next if current_url.host == 'matplotlib.org' |
| 62 | 62 | next if current_url.host == 'numpy.org' |
| 63 | + next if current_url.host == 'requests.readthedocs.io' | |
| 63 | 64 | next unless node['id'] || node.at_css('code, .classifier') |
| 64 | 65 | links = [] |
| 65 | 66 | links << node.children.last.remove while node.children.last.try(:name) == 'a' |
| @@ -0,0 +1,25 @@ | ||
| 1 | +module Docs | |
| 2 | + class Requests < UrlScraper | |
| 3 | + self.type = 'sphinx' | |
| 4 | + self.root_path = 'index.html' | |
| 5 | + self.links = { | |
| 6 | + home: 'https://requests.readthedocs.io/', | |
| 7 | + code: 'https://github.com/psf/requests' | |
| 8 | + } | |
| 9 | + self.release = '2.28.1' | |
| 10 | + self.base_url = "https://requests.readthedocs.io/en/latest/api/" | |
| 11 | + | |
| 12 | + html_filters.push 'requests/entries', 'sphinx/clean_html' | |
| 13 | + | |
| 14 | + options[:container] = '.body > section' | |
| 15 | + | |
| 16 | + options[:attribution] = <<-HTML | |
| 17 | + © 2011-2022 Kenneth Reitz and other contributors<br> | |
| 18 | + Licensed under the Apache license. | |
| 19 | + HTML | |
| 20 | + | |
| 21 | + def get_latest_version(opts) | |
| 22 | + get_latest_github_release('psf', 'requests', opts) | |
| 23 | + end | |
| 24 | + end | |
| 25 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://requests.readthedocs.io/en/latest/_static/requests-sidebar.png | |