diff --git a/assets/images/icons.png b/assets/images/icons.png index 0ac4c714..10f469f5 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index bcd62a0c..8eef93d6 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index b43ec46f..dfd65939 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2015-03-22", + "New mocha documentation" + ], [ "2015-02-22", "Improved HTTP documentation", "New Minitest documentation" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index ddb69f1c..791f2be6 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -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', diff --git a/assets/javascripts/views/pages/javascript.coffee b/assets/javascripts/views/pages/javascript.coffee index 2cffbd49..00fc0ba6 100644 --- a/assets/javascripts/views/pages/javascript.coffee +++ b/assets/javascripts/views/pages/javascript.coffee @@ -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 = diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 088eb94a..033fdf0f 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -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; } diff --git a/assets/stylesheets/pages/_base.scss b/assets/stylesheets/pages/_base.scss index bdd55500..a544e8af 100644 --- a/assets/stylesheets/pages/_base.scss +++ b/assets/stylesheets/pages/_base.scss @@ -19,6 +19,7 @@ } ._lodash, -._sinon { +._sinon, +._mocha { @extend %simple; } diff --git a/lib/docs/filters/mocha/clean_html.rb b/lib/docs/filters/mocha/clean_html.rb new file mode 100644 index 00000000..7532cf53 --- /dev/null +++ b/lib/docs/filters/mocha/clean_html.rb @@ -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 diff --git a/lib/docs/filters/mocha/entries.rb b/lib/docs/filters/mocha/entries.rb new file mode 100644 index 00000000..6dfb4bcd --- /dev/null +++ b/lib/docs/filters/mocha/entries.rb @@ -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 diff --git a/lib/docs/scrapers/mocha.rb b/lib/docs/scrapers/mocha.rb new file mode 100644 index 00000000..803c3aba --- /dev/null +++ b/lib/docs/scrapers/mocha.rb @@ -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
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/mocha/16.png b/public/icons/docs/mocha/16.png new file mode 100644 index 00000000..b78709df Binary files /dev/null and b/public/icons/docs/mocha/16.png differ diff --git a/public/icons/docs/mocha/16@2x.png b/public/icons/docs/mocha/16@2x.png new file mode 100644 index 00000000..93e534d7 Binary files /dev/null and b/public/icons/docs/mocha/16@2x.png differ