Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 135 KiB |
@ -0,0 +1,15 @@
|
||||
._async {
|
||||
@extend %simple;
|
||||
|
||||
h3 > .type-signature {
|
||||
float: right;
|
||||
color: $textColorLight;
|
||||
}
|
||||
|
||||
h3 > .signature-attributes {
|
||||
font-size: .75rem;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
color: $textColorLighter;
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
module Docs
|
||||
class Async
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('#main-container')
|
||||
|
||||
at_css('footer').remove
|
||||
|
||||
css('section', 'header', 'article', '.container-overview', 'span.signature', 'div.description').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('h3', 'h4', 'h5').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i - 1 }
|
||||
end
|
||||
|
||||
css('dd ul').each do |node|
|
||||
node.replace(node.css('li').map(&:inner_html).join(' '))
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node['data-language'] = 'javascript'
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,22 @@
|
||||
module Docs
|
||||
class Async
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
type = nil
|
||||
entries = []
|
||||
|
||||
css('.nav.methods li').each do |node|
|
||||
if node['class'] == 'toc-header'
|
||||
type = node.content
|
||||
else
|
||||
name = node.content
|
||||
id = node.at_css('a')['href'].remove('#')
|
||||
entries << [name, id, type]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,48 @@
|
||||
module Docs
|
||||
class Immutable
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('section', 'span', 'div[data-reactid]').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('.codeBlock').each do |node|
|
||||
node.name = 'pre'
|
||||
node.content = node.content
|
||||
node['data-language'] = 'js'
|
||||
end
|
||||
|
||||
css('*[data-reactid]').remove_attr('data-reactid')
|
||||
css('a[target]').remove_attr('target')
|
||||
|
||||
css('a[href^="#"]').each do |node|
|
||||
node['href'] = node['href'].sub(/\A#\//, '#').gsub('/', '.').downcase
|
||||
end
|
||||
|
||||
type = type_id = nil
|
||||
css('*').each do |node|
|
||||
if node.name == 'h1'
|
||||
node['id'] = type_id = node.content.strip.downcase
|
||||
type = node.content.strip
|
||||
elsif node.name == 'h3'
|
||||
node['id'] = node.content.strip.downcase
|
||||
node['id'] = node['id'].remove('()') unless node['id'] == "#{type_id}()"
|
||||
|
||||
unless node['id'].start_with?(type_id)
|
||||
node.content = "#{type}##{node.content}"
|
||||
node['id'] = "#{type_id}.#{node['id']}" unless node['id'].start_with?("#{type_id}.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
css('h4.groupTitle').each do |node|
|
||||
node.name = 'h2'
|
||||
end
|
||||
|
||||
css('*[class]').remove_attr('class')
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,23 @@
|
||||
module Docs
|
||||
class Immutable
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
entries = []
|
||||
type = nil
|
||||
|
||||
css('*').each do |node|
|
||||
if node.name == 'h1'
|
||||
name = node.content
|
||||
type = node.content.split('.').first
|
||||
entries << [name, node['id'], type]
|
||||
elsif node.name == 'h3'
|
||||
name = node.content
|
||||
entries << [name, node['id'], type]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,56 @@
|
||||
module Docs
|
||||
class Yarn
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
doc
|
||||
end
|
||||
|
||||
def root
|
||||
@doc = at_css('.hero + .container')
|
||||
|
||||
at_css('.row').remove
|
||||
css('> .container', 'hr').remove
|
||||
|
||||
css('.row', '.col-lg-4', '.card-block').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('a.card').each do |node|
|
||||
node.at_css('.float-right').replace %(<br><a href="#{node['href']}">Read more</a>)
|
||||
node.before(node.children).remove
|
||||
end
|
||||
end
|
||||
|
||||
def other
|
||||
@doc = at_css('.guide')
|
||||
|
||||
css('a.toc', '.nav-tabs', '#select-platform', '.guide-controls + .list-group', '.guide-controls').remove
|
||||
|
||||
css('.guide-content', '.tabs', '.tab-content').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
unless at_css('h2')
|
||||
css('h3', 'h4', 'h5').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i - 1 }
|
||||
end
|
||||
end
|
||||
|
||||
unless at_css('h3')
|
||||
css('h4', 'h5').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i - 1 }
|
||||
end
|
||||
end
|
||||
|
||||
css('div.highlighter-rouge').each do |node|
|
||||
node['data-language'] = node['class'][/language-(\w+)/, 1] if node['class']
|
||||
node.content = node.content.strip
|
||||
node.name = 'pre'
|
||||
end
|
||||
|
||||
css('.highlighter-rouge').remove_attr('class')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class Yarn
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = at_css('h1').content
|
||||
|
||||
unless type == 'CLI'
|
||||
name.prepend "#{css('.guide-nav a').to_a.index(at_css('.guide-nav a.active')) + 1}. "
|
||||
end
|
||||
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
type = at_css('.guide-nav a').content.strip
|
||||
type.remove! ' Introduction'
|
||||
type
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class Async < UrlScraper
|
||||
self.type = 'async'
|
||||
self.release = '2.1.2'
|
||||
self.base_url = 'https://caolan.github.io/async/'
|
||||
self.root_path = 'docs.html'
|
||||
self.links = {
|
||||
home: 'https://caolan.github.io/async/',
|
||||
code: 'https://github.com/caolan/async'
|
||||
}
|
||||
|
||||
html_filters.push 'async/entries', 'async/clean_html'
|
||||
|
||||
options[:skip_links] = true
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2010–2016 Caolan McMahon<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
@ -0,0 +1,58 @@
|
||||
module Docs
|
||||
class Immutable < UrlScraper
|
||||
self.name = 'Immutable.js'
|
||||
self.slug = 'immutable'
|
||||
self.type = 'immutable'
|
||||
self.release = '3.8.1'
|
||||
self.base_url = 'https://facebook.github.io/immutable-js/docs/'
|
||||
self.links = {
|
||||
home: 'https://facebook.github.io/immutable-js/',
|
||||
code: 'https://github.com/facebook/immutable-js'
|
||||
}
|
||||
|
||||
html_filters.push 'immutable/clean_html', 'immutable/entries', 'title'
|
||||
|
||||
options[:skip_links] = true
|
||||
options[:container] = '.docContents'
|
||||
options[:root_title] = 'Immutable.js'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2014–2015 Facebook, Inc.<br>
|
||||
Licensed under the 3-clause BSD License.
|
||||
HTML
|
||||
|
||||
stub '' do
|
||||
capybara = load_capybara_selenium
|
||||
capybara.app_host = 'https://facebook.github.io'
|
||||
capybara.visit(URL.parse(self.base_url).path)
|
||||
capybara.execute_script <<-JS
|
||||
var content, event, links, link;
|
||||
|
||||
event = document.createEvent('Event');
|
||||
event.initEvent('hashchange', false, false);
|
||||
|
||||
content = document.querySelector('.docContents section').cloneNode(true);
|
||||
links = Array.prototype.slice.call(document.querySelectorAll('.sideBar .scrollContent a'));
|
||||
|
||||
while (link = links.shift()) {
|
||||
if (!document.body.contains(link)) {
|
||||
document.body.appendChild(link);
|
||||
}
|
||||
|
||||
link.click();
|
||||
dispatchEvent(event);
|
||||
content.innerHTML += document.querySelector('.docContents').innerHTML;
|
||||
|
||||
document.querySelectorAll('.sideBar .scrollContent .groupTitle').forEach(function(el) {
|
||||
if (el.textContent == 'Types') {
|
||||
Array.prototype.unshift.apply(links, Array.prototype.slice.call(el.parentNode.querySelectorAll('a')));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.querySelector('.docContents').innerHTML = content.innerHTML;
|
||||
JS
|
||||
capybara.html
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,24 @@
|
||||
module Docs
|
||||
class Yarn < UrlScraper
|
||||
self.type = 'yarn'
|
||||
self.release = '0.17.6'
|
||||
self.base_url = 'https://yarnpkg.com/en/docs/'
|
||||
self.links = {
|
||||
home: 'https://yarnpkg.com/',
|
||||
code: 'https://github.com/yarnpkg/yarn'
|
||||
}
|
||||
|
||||
html_filters.push 'yarn/entries', 'yarn/clean_html', 'title'
|
||||
|
||||
options[:root_title] = 'Yarn'
|
||||
options[:trailing_slash] = false
|
||||
|
||||
options[:skip] = %w(nightly)
|
||||
options[:skip_patterns] = [/\Aorg\//]
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2016 Yarn Contributors<br>
|
||||
Licensed under the BSD License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 798 B |
@ -0,0 +1 @@
|
||||
https://raw.githubusercontent.com/caolan/async/master/logo/favicon.ico
|
After Width: | Height: | Size: 435 B |
After Width: | Height: | Size: 527 B |
@ -0,0 +1 @@
|
||||
https://raw.githubusercontent.com/facebook/immutable-js/master/pages/src/static/favicon.png
|
After Width: | Height: | Size: 358 B |
After Width: | Height: | Size: 611 B |
@ -0,0 +1 @@
|
||||
https://raw.githubusercontent.com/yarnpkg/website/master/favicon.ico
|