@ -0,0 +1,3 @@
|
||||
._hide-in-development {
|
||||
<%= App.environment != :production ? 'display: none;' : '' %>
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
._mkdocs {
|
||||
h2 { @extend %block-heading; }
|
||||
h3 { @extend %block-label, %label-blue; }
|
||||
h4 { @extend %block-label; }
|
||||
|
||||
blockquote { @extend %note; }
|
||||
|
||||
strong { font-weight: var(--bolderFontWeight); }
|
||||
|
||||
p > code, li > code { @extend %label; }
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
._octave {
|
||||
@extend %simple;
|
||||
|
||||
dl:not([compact]) > dt { @extend %block-label, %label-blue; }
|
||||
|
||||
dl[compact] > dt { @extend %block-label; }
|
||||
|
||||
.footnotes-heading { @extend %block-heading; }
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
._rxjs {
|
||||
@extend %simple;
|
||||
|
||||
.pre-title { @extend %pre-heading; }
|
||||
|
||||
.breadcrumbs { @extend %note; }
|
||||
.banner { @extend %note-green; }
|
||||
code.stable { @extend %label-green; }
|
||||
code.experimental { @extend %label-orange; }
|
||||
code.deprecated { @extend %label-red; }
|
||||
.alert.is-important { @extend %note-red; }
|
||||
.alert.is-helpful, .breadcrumbs { @extend %note-blue; }
|
||||
|
||||
.breadcrumbs { padding-left: 2em; }
|
||||
|
||||
img { margin: 1em 0; }
|
||||
|
||||
.location-badge {
|
||||
font-style: italic;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td h3 { margin: 0 !important; }
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
module Docs
|
||||
class DjangoRestFramework
|
||||
class CleanHtmlFilter < Docs::Filter
|
||||
def call
|
||||
css('hr').remove
|
||||
css('.badges').remove
|
||||
|
||||
css('pre').attr('data-language', 'python')
|
||||
|
||||
css('h1').remove_attribute('style')
|
||||
css('.promo a').remove_attribute('style')
|
||||
|
||||
# Translate source files links to DevDocs links
|
||||
links = Nokogiri::XML::Node.new('p', doc)
|
||||
links['class'] = '_links'
|
||||
|
||||
css('a.github').each do |node|
|
||||
span = node.at_css('span')
|
||||
node.content = span.content
|
||||
node['class'] = '_links-link'
|
||||
links.add_child(node)
|
||||
end
|
||||
|
||||
doc.add_child(links)
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,59 @@
|
||||
module Docs
|
||||
class DjangoRestFramework
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = css('h1').first.content
|
||||
name.slice! 'Tutorial '
|
||||
name = '0: ' + name if name.include? 'Quickstart'
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
case subpath
|
||||
when /\Atutorial/
|
||||
'Tutorial'
|
||||
when /\Aapi-guide/
|
||||
'API Guide'
|
||||
end
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] if type == nil || type == 'Tutorial'
|
||||
|
||||
# Framework classes are provided in two different ways:
|
||||
# - as H2's after H1 category titled:
|
||||
accepted_headers = ['API Reference', 'API Guide']
|
||||
# - as headers (1 or 2) with these endings:
|
||||
endings = ['Validator', 'Field', 'View', 'Mixin', 'Default', 'Serializer']
|
||||
|
||||
# To avoid writing down all the endings
|
||||
# and to ensure all entries in API categories are matched
|
||||
# two different ways of finding them are used
|
||||
|
||||
entries = []
|
||||
|
||||
local_type = 'Ref: ' + name
|
||||
in_category = false
|
||||
|
||||
css('h1, h2').each do |node|
|
||||
# Third party category contains entries that could be matched (and shouldn't be)
|
||||
break if node.content === 'Third party packages'
|
||||
|
||||
if in_category
|
||||
if node.name === 'h1'
|
||||
in_category = false
|
||||
next
|
||||
end
|
||||
entries << [node.content, node['id'], local_type]
|
||||
elsif accepted_headers.include? node.content
|
||||
in_category = true
|
||||
elsif endings.any? { |word| node.content.ends_with?(word) }
|
||||
entries << [node.content, node['id'], local_type]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
module Docs
|
||||
class Gcc
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('pre').each do |node|
|
||||
node['data-language'] = 'cpp'
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
module Docs
|
||||
class Mkdocs
|
||||
class CleanHtmlFilter < Docs::Filter
|
||||
def call
|
||||
css('.toclink').each do |node|
|
||||
node.parent.content = node.content
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.at_css('code').content
|
||||
end
|
||||
|
||||
at_css('#main-content')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,46 @@
|
||||
module Docs
|
||||
class Octave
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
doc
|
||||
end
|
||||
|
||||
def root
|
||||
@doc = at_css('.contents')
|
||||
end
|
||||
|
||||
def other
|
||||
css('.header', 'hr').remove
|
||||
|
||||
css('.footnote > h3').each do |node|
|
||||
node.name = 'h5'
|
||||
end
|
||||
|
||||
at_css('h2, h3, h4').name = 'h1'
|
||||
|
||||
css('.example').each do |node|
|
||||
node.name = 'pre'
|
||||
node['data-language'] = 'matlab'
|
||||
node.content = node.content.strip
|
||||
end
|
||||
|
||||
css('a[name] + dl, a[name] + h4').each do |node|
|
||||
node['id'] = node.previous_element['name']
|
||||
end
|
||||
|
||||
css('dt > a[name]', 'th > a[name]').each do |node|
|
||||
node.parent['id'] = node['name']
|
||||
node.parent.content = node.parent.content.strip
|
||||
end
|
||||
|
||||
css('h5 > a').each do |node|
|
||||
node.parent['id'] = node['name']
|
||||
node.parent.content = node.content
|
||||
end
|
||||
|
||||
xpath('//td[text()=" " and not(descendant::*)]').remove
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,22 @@
|
||||
module Docs
|
||||
class Octave
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').content.sub(/(A?[0-9.]+ )/, '')
|
||||
end
|
||||
|
||||
def get_type
|
||||
return 'Manual: Appendices' if name.start_with?('Appendix')
|
||||
return 'Manual: Indexes' if name.end_with?('Index')
|
||||
'Manual'
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
css('dl:not([compact]) > dt').each_with_object [] do |node, entries|
|
||||
name = node.content.gsub(/[A-z0-9\,… ]*\=/, '').strip.split(' ')[0]
|
||||
entries << [name, node['id'], 'Functions'] unless node['id'] =~ /-\d+\Z/
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,16 @@
|
||||
module Docs
|
||||
class Pony
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('.headerlink').remove
|
||||
css('hr').remove
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,35 @@
|
||||
module Docs
|
||||
class Pony
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
title = context[:html_title].sub(/ - .*/, '').split(' ').last
|
||||
title = "1. #{type}" if title == 'Package'
|
||||
title
|
||||
end
|
||||
|
||||
def get_type
|
||||
subpath.split(/-([^a-z])/)[0][0..-1].sub('-', '/')
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] if root_page? || name.start_with?("1. ")
|
||||
|
||||
entries = []
|
||||
|
||||
css('h3').each do |node|
|
||||
member_name = node.content
|
||||
|
||||
is_field = member_name.start_with?('let ')
|
||||
member_name = member_name[4..-1] if is_field
|
||||
|
||||
member_name = member_name.scan(/^([a-zA-Z0-9_]+)/)[0][0]
|
||||
member_name += '()' unless is_field
|
||||
|
||||
entries << ["#{name}.#{member_name}", node['id']]
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,139 @@
|
||||
module Docs
|
||||
class Rxjs
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
if root_page?
|
||||
css('.card-container').remove
|
||||
at_css('h1').content = 'RxJS Documentation'
|
||||
end
|
||||
|
||||
if at_css('h1').nil?
|
||||
title = subpath.rpartition('/').last.titleize
|
||||
doc.prepend_child("<h1>#{title}</h1>")
|
||||
end
|
||||
|
||||
css('br', 'hr', '.material-icons', '.header-link', '.breadcrumb').remove
|
||||
|
||||
css('.content', 'article', '.api-header', 'section', '.instance-member').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('label', 'h2 > em', 'h3 > em').each do |node|
|
||||
node.name = 'code'
|
||||
end
|
||||
|
||||
css('h1 + code').each do |node|
|
||||
node.before('<p></p>')
|
||||
while node.next_element.name == 'code'
|
||||
node.previous_element << ' '
|
||||
node.previous_element << node.next_element
|
||||
end
|
||||
node.previous_element.prepend_child(node)
|
||||
end
|
||||
|
||||
css('td h3', '.l-sub-section > h3', '.alert h3', '.row-margin > h3', '.api-heading ~ h3', '.api-heading + h2', '.metadata-member h3').each do |node|
|
||||
node.name = 'h4'
|
||||
end
|
||||
|
||||
css('.l-sub-section', '.alert', '.banner').each do |node|
|
||||
node.name = 'blockquote'
|
||||
end
|
||||
|
||||
css('.file').each do |node|
|
||||
node.content = node.content.strip
|
||||
end
|
||||
|
||||
css('.filetree .children').each do |node|
|
||||
node.css('.file').each do |n|
|
||||
n.content = " #{n.content}"
|
||||
end
|
||||
end
|
||||
|
||||
css('.filetree').each do |node|
|
||||
node.content = node.css('.file').map(&:inner_html).join("\n")
|
||||
node.name = 'pre'
|
||||
node.remove_attribute('class')
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content.strip
|
||||
|
||||
node['data-language'] = 'typescript' if node['path'].try(:ends_with?, '.ts')
|
||||
node['data-language'] = 'html' if node['path'].try(:ends_with?, '.html')
|
||||
node['data-language'] = 'css' if node['path'].try(:ends_with?, '.css')
|
||||
node['data-language'] = 'js' if node['path'].try(:ends_with?, '.js')
|
||||
node['data-language'] = 'json' if node['path'].try(:ends_with?, '.json')
|
||||
node['data-language'] = node['language'].sub(/\Ats/, 'typescript').strip if node['language']
|
||||
node['data-language'] ||= 'typescript' if node.content.start_with?('@')
|
||||
|
||||
node.before(%(<div class="pre-title">#{node['title']}</div>)) if node['title']
|
||||
|
||||
if node['class'] && node['class'].include?('api-heading')
|
||||
node.name = 'h3'
|
||||
|
||||
unless node.ancestors('.instance-method').empty?
|
||||
matches = node.inner_html.scan(/([^(& ]+)[(&]/)
|
||||
|
||||
unless matches.empty? || matches[0][0] == 'constructor'
|
||||
node['name'] = matches[0][0]
|
||||
node['id'] = node['name'].downcase + '-'
|
||||
end
|
||||
end
|
||||
|
||||
node.inner_html = "<code>#{node.inner_html}</code>"
|
||||
end
|
||||
|
||||
node.remove_attribute('path')
|
||||
node.remove_attribute('region')
|
||||
node.remove_attribute('linenums')
|
||||
node.remove_attribute('title')
|
||||
node.remove_attribute('language')
|
||||
node.remove_attribute('hidecopy')
|
||||
node.remove_attribute('class')
|
||||
end
|
||||
|
||||
css('td > .overloads').each do |node|
|
||||
node.replace node.at_css('.detail-contents')
|
||||
end
|
||||
|
||||
css('td.short-description p').each do |node|
|
||||
signature = node.parent.parent.next_element.at_css('h3[id]')
|
||||
signature.after(node) unless signature.nil?
|
||||
end
|
||||
|
||||
css('.method-table').each do |node|
|
||||
node.replace node.at_css('tbody')
|
||||
end
|
||||
|
||||
css('.api-body > table > caption').each do |node|
|
||||
node.name = 'center'
|
||||
lift_out_of_table node
|
||||
end
|
||||
|
||||
css('.api-body > table > tbody > tr:not([class]) > td > *').each do |node|
|
||||
lift_out_of_table node
|
||||
end
|
||||
|
||||
css('.api-body > table').each do |node|
|
||||
node.remove if node.content.strip.blank?
|
||||
end
|
||||
|
||||
css('h1[class]').remove_attr('class')
|
||||
css('table[class]').remove_attr('class')
|
||||
css('table[width]').remove_attr('width')
|
||||
css('tr[style]').remove_attr('style')
|
||||
|
||||
css('code code').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
|
||||
def lift_out_of_table(node)
|
||||
table = node.ancestors('table').first
|
||||
table.previous_element.after(node)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
module Docs
|
||||
class Rxjs
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
title = at_css('h1')
|
||||
name = title.nil? ? subpath.rpartition('/').last.titleize : title.content
|
||||
name.prepend "#{$1}. " if subpath =~ /\-pt(\d+)/
|
||||
name += '()' unless at_css('.api-type-label.function').nil?
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
if slug.start_with?('guide')
|
||||
'Guide'
|
||||
elsif slug.start_with?('api/')
|
||||
slug.split('/').second
|
||||
else
|
||||
'Miscellaneous'
|
||||
end
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
css('h3[id]').map do |node|
|
||||
["#{name}.#{node['name']}()", node['id']]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,58 @@
|
||||
module Docs
|
||||
class Trio
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('div[role="main"]')
|
||||
|
||||
css('.section, [itemprop=articleBody]').each do |node|
|
||||
node.replace node.children
|
||||
end
|
||||
|
||||
css('.headerlink').remove
|
||||
|
||||
css('dt').each do |node|
|
||||
node.name = 'h3'
|
||||
|
||||
if node.parent.classes.include? 'field-list'
|
||||
node.name = 'h4'
|
||||
node['style'] = 'margin: 0'
|
||||
|
||||
if node.text == 'Parameters' or node.text == 'Raises'
|
||||
node.next_element.css('strong').each do |n|
|
||||
n.name = 'code'
|
||||
end
|
||||
end
|
||||
else
|
||||
code = doc.document.create_element 'code'
|
||||
|
||||
if em = node.at_css('.property')
|
||||
code.inner_html = "<em>#{em.text.strip}</em> "
|
||||
em.remove
|
||||
end
|
||||
|
||||
code.inner_html += node.inner_text.strip
|
||||
node.inner_html = code
|
||||
end
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content.strip
|
||||
|
||||
classes = node.parent.parent.classes
|
||||
if classes.include? 'highlight-python3'
|
||||
node['data-language'] = 'python'
|
||||
end
|
||||
|
||||
node.parent.parent.replace(node)
|
||||
end
|
||||
|
||||
css('.admonition').each do |node|
|
||||
node.name = 'blockquote'
|
||||
node.at_css('.admonition-title').name = 'h4'
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,48 @@
|
||||
module Docs
|
||||
class Trio
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').text[0...-1]
|
||||
end
|
||||
|
||||
def get_type
|
||||
at_css('h1').text[0...-1]
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
css('.descname').each_with_object [] do |node, entries|
|
||||
name = node.text
|
||||
if node.previous.classes.include? 'descclassname'
|
||||
name = node.previous.text + name
|
||||
end
|
||||
name.strip!
|
||||
|
||||
dl = node.parent.parent
|
||||
|
||||
if dl.classes.include?('attribute') \
|
||||
or dl.classes.include?('method') \
|
||||
or dl.classes.include?('data')
|
||||
parent = dl.parent.previous_element
|
||||
cls = ''
|
||||
|
||||
if n = parent.at_css('.descclassname')
|
||||
cls += n.text
|
||||
end
|
||||
|
||||
if n = parent.at_css('.descname')
|
||||
if n.text == "The nursery interface"
|
||||
cls += "Nursery."
|
||||
else
|
||||
cls += n.text + '.'
|
||||
end
|
||||
end
|
||||
|
||||
name = cls + name
|
||||
end
|
||||
|
||||
entries << [name, node.parent['id']]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
module Docs
|
||||
class Vuex
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.content')
|
||||
|
||||
# Remove video from root page
|
||||
css('a[href="#"]').remove if root_page?
|
||||
|
||||
# Remove unneeded elements
|
||||
css('.header-anchor').remove
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,69 @@
|
||||
module Docs
|
||||
class Vuex
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = at_css('h1').content
|
||||
|
||||
name.remove! '# '
|
||||
|
||||
# Add index on guides
|
||||
unless subpath.start_with?('api')
|
||||
sidebar_link = at_css('.sidebar-link.active')
|
||||
all_links = css('.sidebar-link:not([href="/"]):not([href="../index"])')
|
||||
|
||||
index = all_links.index(sidebar_link)
|
||||
|
||||
name.prepend "#{index + 1}. " if index
|
||||
end
|
||||
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
'Guide'
|
||||
end
|
||||
|
||||
def include_default_entry?
|
||||
name != 'API Reference'
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
return [] unless subpath.start_with?('api')
|
||||
|
||||
entries = [
|
||||
['Component Binding Helpers', 'component-binding-helpers', 'API Reference'],
|
||||
['Store', 'vuex-store', 'API Reference'],
|
||||
]
|
||||
|
||||
css('h3').each do |node|
|
||||
entry_name = node.content.strip
|
||||
|
||||
# Get the previous h2 title
|
||||
title = node
|
||||
title = title.previous_element until title.name == 'h2'
|
||||
title = title.content.strip
|
||||
title.remove! '# '
|
||||
|
||||
entry_name.remove! '# '
|
||||
|
||||
unless entry_name.start_with?('router.')
|
||||
case title
|
||||
when "Vuex.Store Constructor Options"
|
||||
entry_name = "StoreOptions.#{entry_name}"
|
||||
when "Vuex.Store Instance Properties"
|
||||
entry_name = "Vuex.Store.#{entry_name}"
|
||||
when "Vuex.Store Instance Methods"
|
||||
entry_name = "Vuex.Store.#{entry_name}()"
|
||||
when "Component Binding Helpers"
|
||||
entry_name = "#{entry_name}()"
|
||||
end
|
||||
end
|
||||
|
||||
entries << [entry_name, node['id'], 'API Reference']
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
module Docs
|
||||
class DjangoRestFramework < Mkdocs
|
||||
self.name = 'Django REST Framework'
|
||||
self.release = '3.9.3'
|
||||
self.slug = 'django_rest_framework'
|
||||
self.base_url = 'https://www.django-rest-framework.org/'
|
||||
self.root_path = 'index.html'
|
||||
self.links = {
|
||||
home: 'https://www.django-rest-framework.org/',
|
||||
code: 'https://github.com/encode/django-rest-framework'
|
||||
}
|
||||
|
||||
html_filters.push 'django_rest_framework/clean_html', 'django_rest_framework/entries'
|
||||
|
||||
options[:skip_patterns] = [
|
||||
/\Atopics\//,
|
||||
/\Acommunity\//,
|
||||
]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
Copyright © 2011–present Encode OSS Ltd.<br>
|
||||
Licensed under the BSD License.
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_latest_github_release('encode', 'django-rest-framework', opts)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Mkdocs < UrlScraper
|
||||
self.abstract = true
|
||||
self.type = 'mkdocs'
|
||||
|
||||
html_filters.push 'mkdocs/clean_html'
|
||||
|
||||
private
|
||||
|
||||
def handle_response(response)
|
||||
# Some scrapped urls don't have ending slash
|
||||
# which leads to page duplication
|
||||
if !response.url.path.ends_with?('/') && !response.url.path.ends_with?('index.html')
|
||||
response.url.path << '/'
|
||||
end
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,38 @@
|
||||
module Docs
|
||||
class Octave < UrlScraper
|
||||
self.name = 'Octave'
|
||||
self.type = 'octave'
|
||||
self.release = '5.1.0'
|
||||
self.base_url = 'https://octave.org/doc/interpreter/'
|
||||
self.root_path = 'index.html'
|
||||
self.links = {
|
||||
home: 'http://www.octave.org/',
|
||||
code: 'http://www.octave.org/hg/octave'
|
||||
}
|
||||
|
||||
html_filters.push 'octave/clean_html', 'octave/entries', 'title'
|
||||
|
||||
options[:skip] = %w(
|
||||
Copying.html
|
||||
Preface.html
|
||||
Acknowledgements.html
|
||||
Citing-Octave-in-Publications.html
|
||||
How-You-Can-Contribute-to-Octave.html
|
||||
Distribution.html)
|
||||
|
||||
options[:title] = false
|
||||
options[:root_title] = 'GNU Octave'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 1996–2018 John W. Eaton<br>
|
||||
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.<br/>
|
||||
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.</br>
|
||||
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
doc = fetch_doc('https://octave.org/doc/interpreter/', opts)
|
||||
doc.at_css('h1').content.scan(/([0-9.]+)/)[0][0]
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
module Docs
|
||||
class Pony < UrlScraper
|
||||
self.type = 'simple'
|
||||
self.release = '0.30.0'
|
||||
self.base_url = 'https://stdlib.ponylang.io/'
|
||||
self.links = {
|
||||
home: 'https://www.ponylang.io/',
|
||||
code: 'https://github.com/ponylang/ponyc'
|
||||
}
|
||||
|
||||
html_filters.push 'pony/clean_html', 'pony/entries'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2016-2018, The Pony Developers<br>
|
||||
© 2014-2015, Causality Ltd.<br>
|
||||
Licensed under the BSD 2-Clause License.
|
||||
HTML
|
||||
|
||||
options[:container] = 'article'
|
||||
options[:trailing_slash] = false
|
||||
options[:skip_patterns] = [/src/, /stdlib--index/]
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_latest_github_release('ponylang', 'ponyc', opts)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,94 @@
|
||||
require 'yajl/json_gem'
|
||||
|
||||
module Docs
|
||||
class Rxjs < UrlScraper
|
||||
self.name = 'RxJS'
|
||||
self.type = 'rxjs'
|
||||
self.release = '6.5.2'
|
||||
self.base_url = 'https://rxjs.dev/'
|
||||
self.root_path = 'guide/overview'
|
||||
self.links = {
|
||||
home: 'https://rxjs.dev/',
|
||||
code: 'https://github.com/ReactiveX/rxjs'
|
||||
}
|
||||
|
||||
html_filters.push 'rxjs/clean_html', 'rxjs/entries'
|
||||
|
||||
options[:follow_links] = false
|
||||
options[:only_patterns] = [/guide\//, /api\//]
|
||||
options[:skip_patterns] = [/api\/([^\/]+)\.json/]
|
||||
options[:fix_urls_before_parse] = ->(url) do
|
||||
url.sub! %r{\A(\.\/)?guide/}, '/guide/'
|
||||
url.sub! %r{\Aapi/}, '/api/'
|
||||
url.sub! %r{\Agenerated/}, '/generated/'
|
||||
url
|
||||
end
|
||||
|
||||
options[:max_image_size] = 256_000
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.<br>
|
||||
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
json = fetch_json('https://rxjs.dev/generated/navigation.json', opts)
|
||||
json['__versionInfo']['raw']
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def initial_urls
|
||||
initial_urls = []
|
||||
|
||||
Request.run "#{self.class.base_url}generated/navigation.json" do |response|
|
||||
data = JSON.parse(response.body)
|
||||
dig = ->(entry) do
|
||||
initial_urls << url_for("generated/docs/#{entry['url']}.json") if entry['url'] && entry['url'] != 'api'
|
||||
entry['children'].each(&dig) if entry['children']
|
||||
end
|
||||
data['SideNav'].each(&dig)
|
||||
end
|
||||
|
||||
Request.run "#{self.class.base_url}generated/docs/api/api-list.json" do |response|
|
||||
data = JSON.parse(response.body)
|
||||
dig = ->(entry) do
|
||||
initial_urls << url_for("generated/docs/#{entry['path']}.json") if entry['path']
|
||||
initial_urls << url_for("generated/docs/api/#{entry['name']}.json") if entry['name'] && !entry['path']
|
||||
entry['items'].each(&dig) if entry['items']
|
||||
end
|
||||
data.each(&dig)
|
||||
end
|
||||
|
||||
initial_urls.select do |url|
|
||||
options[:only_patterns].any? { |pattern| url =~ pattern } &&
|
||||
options[:skip_patterns].none? { |pattern| url =~ pattern }
|
||||
end
|
||||
end
|
||||
|
||||
def handle_response(response)
|
||||
if response.mime_type.include?('json')
|
||||
begin
|
||||
response.options[:response_body] = JSON.parse(response.body)['contents']
|
||||
rescue JSON::ParserError
|
||||
response.options[:response_body] = ''
|
||||
end
|
||||
response.headers['Content-Type'] = 'text/html'
|
||||
response.url.path = response.url.path.sub('/generated/docs/', '/').remove('.json')
|
||||
response.effective_url.path = response.effective_url.path.sub('/generated/docs/', '/').remove('.json')
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
def parse(response)
|
||||
response.body.gsub! '<code-example', '<pre'
|
||||
response.body.gsub! '</code-example', '</pre'
|
||||
response.body.gsub! '<code-pane', '<pre'
|
||||
response.body.gsub! '</code-pane', '</pre'
|
||||
response.body.gsub! '<live-example></live-example>', 'live example'
|
||||
response.body.gsub! '<live-example', '<span'
|
||||
response.body.gsub! '</live-example', '</span'
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,31 @@
|
||||
module Docs
|
||||
class Trio < UrlScraper
|
||||
self.type = 'simple'
|
||||
self.release = '0.12.1'
|
||||
self.base_url = 'https://trio.readthedocs.io/en/v0.12.1/'
|
||||
self.root_path = 'index.html'
|
||||
self.links = {
|
||||
home: 'https://trio.readthedocs.io/',
|
||||
code: 'https://github.com/python-trio/trio'
|
||||
}
|
||||
|
||||
html_filters.push 'trio/entries', 'trio/clean_html'
|
||||
|
||||
options[:only_patterns] = [
|
||||
/reference-core/,
|
||||
/reference-io/,
|
||||
/reference-testing/,
|
||||
/reference-hazmat/,
|
||||
]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2017 Nathaniel J. Smith<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
doc = fetch_doc('https://trio.readthedocs.io/en/stable/', opts)
|
||||
doc.at_css('.rst-other-versions a[href^="/en/v"]').content[1..-1]
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
module Docs
|
||||
class Vuex < UrlScraper
|
||||
self.type = 'simple'
|
||||
self.release = '3.1.1'
|
||||
self.base_url = 'https://vuex.vuejs.org/'
|
||||
self.links = {
|
||||
home: 'https://vuex.vuejs.org',
|
||||
code: 'https://github.com/vuejs/vuex'
|
||||
}
|
||||
|
||||
html_filters.push 'vuex/entries', 'vuex/clean_html'
|
||||
|
||||
options[:skip_patterns] = [
|
||||
# Other languages
|
||||
/^(zh|ja|ru|kr|fr|ptbr)\//,
|
||||
]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2015–present Evan You<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_npm_version('vuex', opts)
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/encode/django-rest-framework/blob/master/docs_theme/img/favicon.ico
|
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 642 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1 @@
|
||||
https://www.gnu.org/software/octave/img/octave-logo.svg
|
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1 @@
|
||||
https://raw.githubusercontent.com/ponylang/ponylang-website/master/static/images/logo.png
|
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 5.0 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/ReactiveX/reactivex.github.io/blob/develop/favicon.ico
|
After Width: | Height: | Size: 794 B |
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/python-trio/trio/blob/37de153f858e29df3a19db9fffcd0fb3f2308951/logo/logo-transparent-no-text.svg
|
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 1.2 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/vuejs/vuejs.org/blob/master/assets/logo.ai
|