Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -235,6 +235,11 @@ credits = [ · 234 unmodified lines | ||
| 235 | 235 | '2006-2014 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein', |
| 236 | 236 | 'MIT', |
| 237 | 237 | 'https://raw.github.com/nex3/sass/master/MIT-LICENSE' |
| 238 | + ], [ | |
| 239 | + 'Sinon', | |
| 240 | + '2010-2014 Christian Johansen', | |
| 241 | + 'BSD', | |
| 242 | + 'https://raw.githubusercontent.com/cjohansen/Sinon.JS/master/LICENSE' | |
| 238 | 243 | ], [ |
| 239 | 244 | 'Underscore.js', |
| 240 | 245 | '2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', |
| @@ -25,7 +25,7 @@ newsItem = (date, news) -> · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | app.news = [ |
| 27 | 27 | [ 1404172800000, # July 1, 2014 |
| 28 | − """ New <a href="/chai/">Chai</a> documentation """, | |
| 28 | + """ New <a href="/chai/">Chai</a> and <a href="/sinon/">Sinon</a> documentations """, | |
| 29 | 29 | ], [ |
| 30 | 30 | 1402790400000, # June 15, 2014 |
| 31 | 31 | """ New <a href="/requirejs/">RequireJS</a> documentation """, |
| @@ -0,0 +1,4 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | +#= require views/pages/underscore | |
| 3 | + | |
| 4 | +app.views.SinonPage = app.views.UnderscorePage | |
| @@ -54,6 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | 'pages/redis', |
| 55 | 55 | 'pages/requirejs', |
| 56 | 56 | 'pages/rfc', |
| 57 | + 'pages/sinon', | |
| 57 | 58 | 'pages/sphinx', |
| 58 | 59 | 'pages/underscore', |
| 59 | 60 | 'pages/yard', |
| @@ -60,3 +60,4 @@ · 59 unmodified lines | ||
| 60 | 60 | ._icon-haskell:before { background-position: -1rem -9rem; } |
| 61 | 61 | ._icon-requirejs:before { background-position: -2rem -9rem; } |
| 62 | 62 | ._icon-chai:before { background-position: -3rem -9rem; } |
| 63 | +._icon-sinon:before { background-position: -4rem -9rem; } | |
| @@ -0,0 +1,9 @@ | ||
| 1 | +._sinon { | |
| 2 | + padding-left: 1rem; | |
| 3 | + | |
| 4 | + > h1, > h2, > h3 { margin-left: -1rem; } | |
| 5 | + > h2 { @extend %block-heading; } | |
| 6 | + > h3 { @extend %block-label, %label-blue; } | |
| 7 | + | |
| 8 | + dt > code { @extend %label; } | |
| 9 | +} | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +module Docs | |
| 2 | + class Sinon | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + css('> p:first-child', 'a.api', 'ul.nav').remove | |
| 6 | + | |
| 7 | + css('.section', 'h2 code', 'h3 code').each do |node| | |
| 8 | + node.before(node.children).remove | |
| 9 | + end | |
| 10 | + | |
| 11 | + # Remove code highlighting | |
| 12 | + css('pre').each do |node| | |
| 13 | + node.content = node.content | |
| 14 | + end | |
| 15 | + | |
| 16 | + doc | |
| 17 | + end | |
| 18 | + end | |
| 19 | + end | |
| 20 | +end | |
| @@ -0,0 +1,47 @@ | ||
| 1 | +module Docs | |
| 2 | + class Sinon | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def additional_entries | |
| 5 | + entries = [] | |
| 6 | + type = config = nil | |
| 7 | + | |
| 8 | + css('*').each do |node| | |
| 9 | + if node.name == 'h2' | |
| 10 | + config = false | |
| 11 | + type = node.content.strip | |
| 12 | + type.remove! 'Test ' | |
| 13 | + type.remove! 'Sinon.JS ' | |
| 14 | + type = type[0].upcase + type.from(1) | |
| 15 | + | |
| 16 | + id = type.parameterize | |
| 17 | + node['id'] = id | |
| 18 | + | |
| 19 | + entries << [type, id, 'Sections'] | |
| 20 | + elsif node.name == 'h3' && node.content.include?('sinon.config') | |
| 21 | + config = true | |
| 22 | + elsif node.name == 'dl' | |
| 23 | + node.css('dt > code').each do |code| | |
| 24 | + name = code.content.strip | |
| 25 | + name.sub! %r{\(.*\);?}, '()' | |
| 26 | + name.sub! %r{\Aserver.(\w+)\s=.*\z}, 'server.\1' | |
| 27 | + name.remove! '`' | |
| 28 | + name.remove! %r{\A.+?\=\s+} | |
| 29 | + name.remove! %r{\A\w+?\s} | |
| 30 | + name.prepend 'sinon.config.' if config | |
| 31 | + | |
| 32 | + next if name =~ /\s/ | |
| 33 | + next if entries.any? { |entry| entry[0].casecmp(name) == 0 } | |
| 34 | + | |
| 35 | + id = name.parameterize | |
| 36 | + code.parent['id'] = id | |
| 37 | + | |
| 38 | + entries << [name, id, type] | |
| 39 | + end | |
| 40 | + end | |
| 41 | + end | |
| 42 | + | |
| 43 | + entries | |
| 44 | + end | |
| 45 | + end | |
| 46 | + end | |
| 47 | +end | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +module Docs | |
| 2 | + class Sinon < UrlScraper | |
| 3 | + self.name = 'Sinon' | |
| 4 | + self.type = 'sinon' | |
| 5 | + self.version = '1.10.2' | |
| 6 | + self.base_url = 'http://sinonjs.org/docs/' | |
| 7 | + | |
| 8 | + html_filters.push 'sinon/clean_html', 'sinon/entries', 'title' | |
| 9 | + | |
| 10 | + options[:title] = 'Sinon.JS' | |
| 11 | + options[:container] = '.docs' | |
| 12 | + options[:skip_links] = true | |
| 13 | + | |
| 14 | + options[:attribution] = <<-HTML | |
| 15 | + © 2010–2014 Christian Johansen<br> | |
| 16 | + Licensed under the BSD License. | |
| 17 | + HTML | |
| 18 | + end | |
| 19 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/Kapeli/Dash-X-Platform-Resources/blob/master/docset_icons/sinon%402x.png | |