mirror of https://github.com/freeCodeCamp/devdocs
parent
a0cfe45f21
commit
6e43cfe7ba
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 134 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,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
|
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
|
Loading…
Reference in new issue