Add Jest documentation

pull/500/merge
Thibaut Courouble 8 years ago
parent 22461b057d
commit aa1be2f49d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 143 KiB

@ -1,7 +1,7 @@
[
[
"2017-05-14",
"New documentation: <a href=\"/liquid/\">Liquid</a>"
"New documentations: <a href=\"/jest/\">Jest</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'
], [
'Jest',
'2014-present Facebook Inc.',
'BSD',
'https://raw.githubusercontent.com/facebook/jest/master/LICENSE'
], [
'jQuery',
'Packt Publishing<br>&copy; jQuery Foundation and other contributors',

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

@ -43,6 +43,7 @@
%icon-clipboard-white { background-position: -1rem -2rem; }
%icon-close-white { background-position: -2rem -2rem; }
._icon-jest:before { background-position: 0 0; }
._icon-liquid:before { background-position: -1rem 0; }
._icon-openjdk:before { background-position: -2rem 0; }
._icon-codeceptjs:before { background-position: -3rem 0; }

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

@ -0,0 +1,29 @@
module Docs
class Jest
class CleanHtmlFilter < Filter
def call
@doc = at_css('.mainContainer .post')
at_css('h1').content = 'Jest' if root_page?
css('.edit-page-link', '.hash-link', 'hr').remove
css('.postHeader', 'article', 'div:not([class])').each do |node|
node.before(node.children).remove
end
css('.anchor[name]').each do |node|
node.parent['id'] = node['name']
node.remove
end
css('pre').each do |node|
node['data-language'] = node['class'][/language-(\w+)/, 1]
node.content = node.content
end
doc
end
end
end
end

@ -0,0 +1,35 @@
module Docs
class Jest
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('.mainContainer h1').content
end
def get_type
type = at_css('.navItemActive').ancestors('.navGroup').first.at_css('h3').content
if type == 'Introduction'
'Guides: Introduction'
elsif type == 'API Reference'
self.name
else
type
end
end
def additional_entries
return [] unless !root_page? && self.type == self.name # api page
at_css('.mainContainer ul').css('li > a').map do |node|
name = node.at_css('code').content.strip
name.sub! %r{\(.*\)}, '()'
name.remove! %r{[\s=<].*}
name.prepend 'jest ' if name.start_with?('--')
name.prepend 'Config: ' if slug == 'configuration'
id = node['href'].remove('#')
[name, id]
end
end
end
end
end

@ -0,0 +1,21 @@
module Docs
class Jest < UrlScraper
self.type = 'jest'
self.release = '20.0.1'
self.base_url = 'https://facebook.github.io/jest/docs/en/'
self.root_path = 'getting-started.html'
self.links = {
home: 'https://facebook.github.io/jest/',
code: 'https://github.com/facebook/jest'
}
html_filters.push 'jest/entries', 'jest/clean_html'
options[:container] = '.docMainWrapper'
options[:attribution] = <<-HTML
&copy; 2014&ndash;present Facebook Inc.<br>
Licensed under the BSD License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 784 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1 @@
https://github.com/facebook/jest/tree/master/website/src/jest/img
Loading…
Cancel
Save