diff --git a/assets/images/docs.png b/assets/images/docs.png
index 1f47bf6a..86e4aec8 100644
Binary files a/assets/images/docs.png and b/assets/images/docs.png differ
diff --git a/assets/images/docs@2x.png b/assets/images/docs@2x.png
index 2bd7095b..3d9e499c 100644
Binary files a/assets/images/docs@2x.png and b/assets/images/docs@2x.png differ
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index b92d5ea8..7157b6e7 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -531,9 +531,9 @@ credits = [
'https://raw.githubusercontent.com/scikit-learn/scikit-learn/master/COPYING'
], [
'Sinon',
- '2010-2016 Christian Johansen',
+ '2010-2017 Christian Johansen',
'BSD',
- 'https://raw.githubusercontent.com/cjohansen/Sinon.JS/master/LICENSE'
+ 'https://raw.githubusercontent.com/sinonjs/sinon/master/LICENSE'
], [
'Socket.io',
'2014-2015 Automattic',
diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss
index 1834cde4..16d96c6e 100644
--- a/assets/stylesheets/application-dark.css.scss
+++ b/assets/stylesheets/application-dark.css.scss
@@ -81,6 +81,7 @@
'pages/rfc',
'pages/rubydoc',
'pages/rust',
+ 'pages/sinon',
'pages/socketio',
'pages/sphinx',
'pages/sphinx_simple',
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index 46fb7626..e391bfff 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -81,6 +81,7 @@
'pages/rfc',
'pages/rubydoc',
'pages/rust',
+ 'pages/sinon',
'pages/socketio',
'pages/sphinx',
'pages/sphinx_simple',
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index 4252d574..6776255d 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -93,7 +93,7 @@
._icon-haskell:before { background-position: -6rem -4rem; }
._icon-requirejs:before { background-position: -7rem -4rem; }
._icon-chai:before { background-position: -8rem -4rem; }
-._icon-sinon:before { background-position: -9rem -4rem; @extend %darkIconFix !optional; }
+._icon-sinon:before { background-position: -9rem -4rem; }
._icon-cordova:before { background-position: 0 -5rem; }
._icon-markdown:before { background-position: -1rem -5rem; @extend %darkIconFix !optional; }
._icon-django:before { background-position: -2rem -5rem; }
diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss
index 48279b8f..7a770959 100644
--- a/assets/stylesheets/pages/_simple.scss
+++ b/assets/stylesheets/pages/_simple.scss
@@ -35,7 +35,6 @@
._mocha,
._mongoose,
._redux,
-._sinon,
._typescript,
._yarn {
@extend %simple;
diff --git a/assets/stylesheets/pages/_sinon.scss b/assets/stylesheets/pages/_sinon.scss
new file mode 100644
index 00000000..5df93ddd
--- /dev/null
+++ b/assets/stylesheets/pages/_sinon.scss
@@ -0,0 +1,5 @@
+._sinon {
+ @extend %simple;
+
+ h4 { @extend %block-label;}
+}
diff --git a/lib/docs/filters/sinon/clean_html.rb b/lib/docs/filters/sinon/clean_html.rb
index a63de925..0c301206 100644
--- a/lib/docs/filters/sinon/clean_html.rb
+++ b/lib/docs/filters/sinon/clean_html.rb
@@ -2,15 +2,21 @@ module Docs
class Sinon
class CleanHtmlFilter < Filter
def call
- css('> p:first-child', 'a.api', 'ul.nav').remove
+ if root_page?
+ at_css('h1').content = 'Sinon.JS'
+ else
+ css('h1').each do |node|
+ node.content = node.content.remove(' - Sinon.JS')
+ end
+ end
- css('.section', 'h2 code', 'h3 code').each do |node|
+ css('.post', '.post-header', '.post-content', 'pre code').each do |node|
node.before(node.children).remove
end
- # Remove code highlighting
+ css('h1 + h1').remove
+
css('pre').each do |node|
- node.content = node.content
node['data-language'] = 'javascript'
end
diff --git a/lib/docs/filters/sinon/entries.rb b/lib/docs/filters/sinon/entries.rb
index 9096f87d..aa7db484 100644
--- a/lib/docs/filters/sinon/entries.rb
+++ b/lib/docs/filters/sinon/entries.rb
@@ -1,46 +1,27 @@
module Docs
class Sinon
class EntriesFilter < Docs::EntriesFilter
- def additional_entries
- entries = []
- type = config = nil
-
- css('*').each do |node|
- if node.name == 'h2'
- config = false
- type = node.content.strip
- type.remove! 'Test '
- type.remove! 'Sinon.JS '
- type = type[0].upcase + type.from(1)
-
- id = type.parameterize
- node['id'] = id
+ def get_name
+ at_css('h1').content.strip
+ end
- entries << [type, id, 'Sections']
- elsif node.name == 'h3' && node.content.include?('sinon.config')
- config = true
- elsif node.name == 'dl'
- node.css('dt > code').each do |code|
- name = code.content.strip
- name.sub! %r{\(.*\);?}, '()'
- name.sub! %r{\Aserver.(\w+)\s=.*\z}, 'server.\1'
- name.remove! '`'
- name.remove! %r{\A.+?\=\s+}
- name.remove! %r{\A\w+?\s}
- name.prepend 'sinon.config.' if config
+ def get_type
+ name
+ end
- next if name =~ /\s/
- next if entries.any? { |entry| entry[0].casecmp(name) == 0 }
+ def additional_entries
+ css('h4 > code').each_with_object [] do |node, entries|
+ name = node.content.strip
+ name.sub! %r{\s*\(.*\);?}, '()'
+ name.sub! %r{\A(\w+\.\w+)\s+\=.*}, '\1'
+ name.remove! %r{\A.+?\=\s+}
+ name.remove! %r{\A\w+?\s}
+ name.remove! %r{;\z}
- id = name.parameterize
- code.parent['id'] = id
+ next if entries.any? { |entry| entry[0].casecmp(name) == 0 }
- entries << [name, id, type]
- end
- end
+ entries << [name, node.parent['id']]
end
-
- entries
end
end
end
diff --git a/lib/docs/scrapers/sinon.rb b/lib/docs/scrapers/sinon.rb
index d330b351..604add02 100644
--- a/lib/docs/scrapers/sinon.rb
+++ b/lib/docs/scrapers/sinon.rb
@@ -1,23 +1,31 @@
module Docs
class Sinon < UrlScraper
- self.name = 'Sinon'
+ self.name = 'Sinon.JS'
+ self.slug = 'sinon'
self.type = 'sinon'
- self.release = '1.17.5'
- self.base_url = 'http://sinonjs.org/docs/'
self.links = {
home: 'http://sinonjs.org/',
- code: 'https://github.com/cjohansen/Sinon.JS'
+ code: 'https://github.com/sinonjs/sinon'
}
- html_filters.push 'sinon/clean_html', 'sinon/entries', 'title'
+ html_filters.push 'sinon/clean_html', 'sinon/entries'
options[:title] = 'Sinon.JS'
- options[:container] = '.docs'
- options[:skip_links] = true
+ options[:container] = '.content .container'
options[:attribution] = <<-HTML
- © 2010–2016 Christian Johansen
+ © 2010–2017 Christian Johansen
Licensed under the BSD License.
HTML
+
+ version '2' do
+ self.release = '2.1.0'
+ self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ end
+
+ version '1' do
+ self.release = '1.17.7'
+ self.base_url = "http://sinonjs.org/releases/v#{release}/"
+ end
end
end
diff --git a/public/icons/docs/sinon/16.png b/public/icons/docs/sinon/16.png
index 22177d34..557346af 100644
Binary files a/public/icons/docs/sinon/16.png and b/public/icons/docs/sinon/16.png differ
diff --git a/public/icons/docs/sinon/16@2x.png b/public/icons/docs/sinon/16@2x.png
index db542d90..79848f03 100644
Binary files a/public/icons/docs/sinon/16@2x.png and b/public/icons/docs/sinon/16@2x.png differ
diff --git a/public/icons/docs/sinon/SOURCE b/public/icons/docs/sinon/SOURCE
index dce65418..c852cb4d 100644
--- a/public/icons/docs/sinon/SOURCE
+++ b/public/icons/docs/sinon/SOURCE
@@ -1 +1 @@
-https://github.com/Kapeli/Dash-X-Platform-Resources/blob/master/docset_icons/sinon%402x.png
+https://github.com/sinonjs/sinon/blob/master/docs/assets/images/logo.png