diff --git a/assets/images/docs-2.png b/assets/images/docs-2.png index 276d1f56..d89c62d8 100644 Binary files a/assets/images/docs-2.png and b/assets/images/docs-2.png differ diff --git a/assets/images/docs-2@2x.png b/assets/images/docs-2@2x.png index d4b8f4cb..b24abf3d 100644 Binary files a/assets/images/docs-2@2x.png and b/assets/images/docs-2@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index cde0359f..2fc087ef 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2017-05-14", - "New documentations: Jest and Liquid" + "New documentations: Jest, Jasmine and Liquid" ], [ "2017-04-30", "New documentation: OpenJDK" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index fe1895ea..29b2a192 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -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.', diff --git a/assets/javascripts/views/pages/simple.coffee b/assets/javascripts/views/pages/simple.coffee index 23ed2fcd..0c9beb24 100644 --- a/assets/javascripts/views/pages/simple.coffee +++ b/assets/javascripts/views/pages/simple.coffee @@ -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 = diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index ed5af50f..7f8d8f7f 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -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; } diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index d6980e39..1693f03f 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -28,6 +28,7 @@ ._haxe, ._immutable, ._influxdata, +._jasmine, ._jest, ._less, ._lodash, diff --git a/lib/docs/filters/jasmine/clean_html.rb b/lib/docs/filters/jasmine/clean_html.rb new file mode 100644 index 00000000..ea58f127 --- /dev/null +++ b/lib/docs/filters/jasmine/clean_html.rb @@ -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 diff --git a/lib/docs/filters/jasmine/entries.rb b/lib/docs/filters/jasmine/entries.rb new file mode 100644 index 00000000..4bb6a59e --- /dev/null +++ b/lib/docs/filters/jasmine/entries.rb @@ -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 diff --git a/lib/docs/scrapers/jasmine.rb b/lib/docs/scrapers/jasmine.rb new file mode 100644 index 00000000..fd83e06a --- /dev/null +++ b/lib/docs/scrapers/jasmine.rb @@ -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 + © 2008–2017 Pivotal Labs
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/jasmine/16.png b/public/icons/docs/jasmine/16.png new file mode 100644 index 00000000..0c04fe9f Binary files /dev/null and b/public/icons/docs/jasmine/16.png differ diff --git a/public/icons/docs/jasmine/16@2x.png b/public/icons/docs/jasmine/16@2x.png new file mode 100644 index 00000000..e2a4e657 Binary files /dev/null and b/public/icons/docs/jasmine/16@2x.png differ diff --git a/public/icons/docs/jasmine/SOURCE b/public/icons/docs/jasmine/SOURCE new file mode 100644 index 00000000..a961dae5 --- /dev/null +++ b/public/icons/docs/jasmine/SOURCE @@ -0,0 +1 @@ +https://github.com/jasmine/jasmine.github.io/tree/master/images