CodeceptJS documentation

pull/547/head
edno 8 years ago committed by Thibaut Courouble
parent 802a8d3804
commit 1fda4fcb0c

@ -0,0 +1,9 @@
#= require views/pages/base
class app.views.CodeceptjsPage extends app.views.BasePage
prepare: ->
for el in @findAll('pre > code')
if /js/i.test(el.className)
@highlightCode(el, 'javascript')
return

@ -40,6 +40,7 @@
'pages/cakephp',
'pages/clojure',
'pages/codeception',
'pages/codeceptjs',
'pages/coffeescript',
'pages/cordova',
'pages/crystal',

@ -40,6 +40,7 @@
'pages/cakephp',
'pages/clojure',
'pages/codeception',
'pages/codeceptjs',
'pages/coffeescript',
'pages/cordova',
'pages/crystal',

@ -0,0 +1,3 @@
._codeceptjs {
@extend %simple;
}

@ -0,0 +1,19 @@
module Docs
class Codeceptjs
class CleanHtmlFilter < Filter
def call
root_page? ? root : other
doc
end
def root
doc.inner_html = ' '
end
def other
@doc = doc.at_css('div.reference').xpath('//div[@role="main"]')
doc
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class Codeceptjs
class EntriesFilter < Docs::EntriesFilter
def get_name
(at_css('h1') || at_css('h2')).content
end
def get_type
return "Reference" if %w(commands configuration reports translation).include? subpath.scan(/\w+/).first
return "Guides" unless slug.camelize =~ /Helpers::.+/
"Helpers::" + (at_css('h1') || at_css('h2')).content
end
def additional_entries
return [] unless type =~ /Helpers::.*/
helper = type.sub(/Helpers::/, '')+ '::'
css('h2').map do |node|
next if node['id'] == 'access-from-helpers'
[helper + node.content, node['id']]
end.compact
end
end
end
end

@ -0,0 +1,25 @@
module Docs
class Codeceptjs < UrlScraper
self.name = 'CodeceptJS'
self.type = 'codeceptjs'
self.root_path = 'index.html'
self.release = '0.4'
self.base_url = 'http://codecept.io/'
self.links = {
home: 'http://codecept.io/',
code: 'https://github.com/codeception/codeceptjs'
}
html_filters.push 'codeceptjs/clean_html', 'codeceptjs/entries', 'title'
options[:root_title] = 'CodeceptJS'
options[:title] = false
options[:skip_links] = ->(filter) { !filter.initial_page? }
options[:skip_patterns] = [/changelog/, /quickstart$/]
options[:attribution] = <<-HTML
&copy; 20152016 Michael Bodnarchuk and Contributors<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1 @@
http://codecept.io/images/cjs-base.png
Loading…
Cancel
Save