Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 140 KiB |
@ -0,0 +1,5 @@
|
||||
._sinon {
|
||||
@extend %simple;
|
||||
|
||||
h4 { @extend %block-label;}
|
||||
}
|
@ -1,47 +1,28 @@
|
||||
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)
|
||||
def get_name
|
||||
at_css('h1').content.strip
|
||||
end
|
||||
|
||||
id = type.parameterize
|
||||
node['id'] = id
|
||||
def get_type
|
||||
name
|
||||
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! '`'
|
||||
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.prepend 'sinon.config.' if config
|
||||
name.remove! %r{;\z}
|
||||
|
||||
next if name =~ /\s/
|
||||
next if entries.any? { |entry| entry[0].casecmp(name) == 0 }
|
||||
|
||||
id = name.parameterize
|
||||
code.parent['id'] = id
|
||||
|
||||
entries << [name, id, type]
|
||||
end
|
||||
entries << [name, node.parent['id']]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -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<br>
|
||||
© 2010–2017 Christian Johansen<br>
|
||||
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
|
||||
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 442 B After Width: | Height: | Size: 1.7 KiB |
@ -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
|
||||
|