mirror of https://github.com/freeCodeCamp/devdocs
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
|
@ -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
|
After Width: | Height: | Size: 855 B |
After Width: | Height: | Size: 2.1 KiB |
@ -0,0 +1 @@
|
||||
http://codecept.io/images/cjs-base.png
|
Loading…
Reference in new issue