Add Jasmine documentation

pull/500/merge
Thibaut Courouble 8 years ago
parent c13877f833
commit 7a1ca03397

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 36 KiB

@ -1,7 +1,7 @@
[
[
"2017-05-14",
"New documentations: <a href=\"/jest/\">Jest</a> and <a href=\"/liquid/\">Liquid</a>"
"New documentations: <a href=\"/jest/\">Jest</a>, <a href=\"/jasmine/\">Jasmine</a> and <a href=\"/liquid/\">Liquid</a>"
], [
"2017-04-30",
"New documentation: <a href=\"/openjdk/\">OpenJDK</a>"

@ -283,6 +283,11 @@ credits = [
'2015 InfluxData, Inc.',
'MIT',
'https://github.com/influxdata/docs.influxdata.com/blob/master/LICENSE'
], [
'Jasmine',
'2008-2017 Pivotal Labs',
'MIT',
'https://raw.githubusercontent.com/jasmine/jasmine/master/MIT.LICENSE'
], [
'Jest',
'2014-present Facebook Inc.',

@ -28,6 +28,7 @@ app.views.ExpressPage =
app.views.GoPage =
app.views.ImmutablePage =
app.views.InfluxdataPage =
app.views.JasminePage =
app.views.JestPage =
app.views.KnockoutPage =
app.views.KotlinPage =

@ -171,3 +171,4 @@
._icon-padrino:before { background-position: -7rem -1rem; @extend %doc-icon-2; }
._icon-angular:before { background-position: -8rem -1rem; @extend %doc-icon-2; }
._icon-love:before { background-position: -9rem -1rem; @extend %doc-icon-2; }
._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; }

@ -28,6 +28,7 @@
._haxe,
._immutable,
._influxdata,
._jasmine,
._jest,
._less,
._lodash,

@ -0,0 +1,30 @@
module Docs
class Jasmine
class CleanHtmlFilter < Filter
def call
@doc = at_css('.docs')
at_css('h1').content = 'Jasmine' if root_page?
css('header', 'article', 'section:not([class])', 'div.description').each do |node|
node.before(node.children).remove
end
css('h3.subsection-title').each do |node|
node.name = 'h2'
end
css('h4.name').each do |node|
node.name = 'h3'
end
css('pre').each do |node|
node.content = node.content
node['data-language'] = 'javascript'
end
doc
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class Jasmine
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('h1').content.strip
name.remove! %r{\A\w+:\s}
name
end
def get_type
at_css('h1').content.strip
end
def additional_entries
css('h3[id]').each_with_object [] do |node, entries|
name = node.content.strip
next if name.start_with?('new ')
static = name.sub! '(static) ', ''
name.sub! %r{\(.*\)}, '()'
name.remove! %r{\s.*}
name.prepend "#{self.name}#{static ? '.' : '#'}" unless slug == 'global'
entries << [name, node['id']]
end
end
end
end
end

@ -0,0 +1,21 @@
module Docs
class Jasmine < UrlScraper
self.type = 'jasmine'
self.release = '2.6.1'
self.base_url = 'https://jasmine.github.io/api/2.6/'
self.root_path = 'index.html'
self.links = {
home: 'https://jasmine.github.io/',
code: 'https://github.com/jasmine/jasmine'
}
html_filters.push 'jasmine/clean_html', 'jasmine/entries'
options[:container] = '.main-content'
options[:attribution] = <<-HTML
&copy; 2008&ndash;2017 Pivotal Labs<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 909 B

@ -0,0 +1 @@
https://github.com/jasmine/jasmine.github.io/tree/master/images
Loading…
Cancel
Save