mirror of https://github.com/freeCodeCamp/devdocs
parent
4da29f8158
commit
76412b3fba
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
@ -0,0 +1,15 @@
|
|||||||
|
module Docs
|
||||||
|
class Mocha
|
||||||
|
class CleanHtmlFilter < Filter
|
||||||
|
def call
|
||||||
|
doc.child.remove until doc.child['id'] == 'installation'
|
||||||
|
|
||||||
|
css('pre').each do |node|
|
||||||
|
node.content = node.content
|
||||||
|
end
|
||||||
|
|
||||||
|
doc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,34 @@
|
|||||||
|
module Docs
|
||||||
|
class Mocha
|
||||||
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
ENTRIES = {
|
||||||
|
'asynchronous-code' => ['done()'],
|
||||||
|
'hooks' => ['before()', 'after()', 'beforeEach()', 'afterEach()', 'suiteSetup()', 'suiteTeardown()', 'setup()', 'teardown()'],
|
||||||
|
'exclusive-tests' => ['only()'],
|
||||||
|
'inclusive-tests' => ['skip()'],
|
||||||
|
'usage' => ['mocha'],
|
||||||
|
'bdd-interface' => ['describe()', 'context()', 'it()'],
|
||||||
|
'tdd-interface' => ['suite()', 'test()'],
|
||||||
|
'exports-interface' => ['exports'],
|
||||||
|
'qunit-interface' => ['QUnit'],
|
||||||
|
'require-interface' => ['require'],
|
||||||
|
'browser-setup' => ['setup()'],
|
||||||
|
'mocha.opts' => ['mocha.opts'],
|
||||||
|
'suite-specific-timeouts' => ['timeout()']
|
||||||
|
}
|
||||||
|
|
||||||
|
def additional_entries
|
||||||
|
ENTRIES.each_with_object [] do |(id, names), entries|
|
||||||
|
type = case id
|
||||||
|
when 'hooks' then 'Hooks'
|
||||||
|
when /interface/ then 'Interfaces'
|
||||||
|
else 'Miscellaneous' end
|
||||||
|
|
||||||
|
names.each do |name|
|
||||||
|
entries << [name, id, type]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,23 @@
|
|||||||
|
module Docs
|
||||||
|
class Mocha < UrlScraper
|
||||||
|
self.name = 'mocha'
|
||||||
|
self.type = 'mocha'
|
||||||
|
self.version = '2.2.1'
|
||||||
|
self.base_url = 'http://mochajs.org/'
|
||||||
|
self.links = {
|
||||||
|
home: 'http://mochajs.org/',
|
||||||
|
code: 'https://github.com/mochajs/mocha'
|
||||||
|
}
|
||||||
|
|
||||||
|
html_filters.push 'mocha/entries', 'mocha/clean_html', 'title'
|
||||||
|
|
||||||
|
options[:container] = '#content'
|
||||||
|
options[:title] = 'mocha'
|
||||||
|
options[:skip_links] = true
|
||||||
|
|
||||||
|
options[:attribution] = <<-HTML
|
||||||
|
© 2011–2015 TJ Holowaychuk<br>
|
||||||
|
Licensed under the MIT License.
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 176 B |
After Width: | Height: | Size: 270 B |
Loading…
Reference in new issue