mirror of https://github.com/freeCodeCamp/devdocs
parent
94e02963be
commit
46f6db4a90
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,4 @@
|
||||
#= require views/pages/base
|
||||
#= require views/pages/underscore
|
||||
|
||||
app.views.ChaiPage = app.views.UnderscorePage
|
@ -0,0 +1,13 @@
|
||||
._chai {
|
||||
padding-left: 1rem;
|
||||
|
||||
> h1, > h2, h3 { margin-left: -1rem; }
|
||||
> h2 { @extend %block-heading; }
|
||||
h3 { @extend %block-label, %label-blue; }
|
||||
h4 { font-size: 1em; }
|
||||
|
||||
code { @extend %label; }
|
||||
blockquote { @extend %note; }
|
||||
|
||||
li.tag span { margin-right: 5px; }
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
module Docs
|
||||
class Chai
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
@doc = at_css('.documentation .rendered')
|
||||
|
||||
if root_page?
|
||||
at_css('h1').content = 'Chai Assertion Library'
|
||||
end
|
||||
|
||||
css('> article', '.header').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
# Remove code highlighting
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,22 @@
|
||||
module Docs
|
||||
class Chai
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def get_type
|
||||
subpath.start_with?('/guide') ? 'Guides' : nil
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
css('.antiscroll-inner a').each_with_object [] do |node, entries|
|
||||
id = node['href'].remove('#') + '-section'
|
||||
node.content.strip.split(' / ').uniq { |name| name.downcase }.each do |name|
|
||||
entries << [name, id, self.name]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,23 @@
|
||||
module Docs
|
||||
class Chai < UrlScraper
|
||||
self.name = 'Chai'
|
||||
self.type = 'chai'
|
||||
self.version = '1.9.1'
|
||||
self.base_url = 'http://chaijs.com'
|
||||
self.root_path = '/api/'
|
||||
self.initial_paths = %w(/guide/installation/)
|
||||
|
||||
html_filters.push 'chai/entries', 'chai/clean_html'
|
||||
|
||||
options[:container] = '#content'
|
||||
options[:trailing_slash] = true
|
||||
|
||||
options[:only_patterns] = [/\A\/guide/, /\A\/api/]
|
||||
options[:skip] = %w(/api/test/ /guide/ /guide/resources/)
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2011–2014 Jake Luer<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 804 B |
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1 @@
|
||||
http://chaijs.com/
|
Loading…
Reference in new issue