Add mocha documentation

pull/185/head
Thibaut 10 years ago
parent 4da29f8158
commit 76412b3fba

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

@ -1,5 +1,8 @@
[
[
"2015-03-22",
"New <a href=\"/mocha/\">mocha</a> documentation"
], [
"2015-02-22",
"Improved <a href=\"/http/\">HTTP</a> documentation",
"New <a href=\"/minitest/\">Minitest</a> documentation"

@ -225,6 +225,11 @@ credits = [
'Ryan Davis, seattle.rb',
'MIT',
'https://raw.githubusercontent.com/seattlerb/minitest/master/README.txt'
], [
'Mocha',
'2011-2015 TJ Holowaychuk',
'MIT',
'https://raw.githubusercontent.com/mochajs/mocha/master/LICENSE'
], [
'Modernizr',
'2009-2014 Modernizr',

@ -20,6 +20,7 @@ app.views.ExpressPage =
app.views.GruntPage =
app.views.LodashPage =
app.views.MarionettePage =
app.views.MochaPage =
app.views.ModernizrPage =
app.views.MomentPage =
app.views.MongoosePage =

@ -97,3 +97,4 @@
._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; }
._icon-clojure:before { background-position: -4rem -7rem; }
._icon-symfony:before { background-position: -5rem -7rem; }
._icon-mocha:before { background-position: -6rem -7rem; }

@ -19,6 +19,7 @@
}
._lodash,
._sinon {
._sinon,
._mocha {
@extend %simple;
}

@ -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
&copy; 2011&ndash;2015 TJ Holowaychuk<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Loading…
Cancel
Save