diff --git a/assets/images/docs.png b/assets/images/docs.png index 78c65c68..d6acb42e 100644 Binary files a/assets/images/docs.png and b/assets/images/docs.png differ diff --git a/assets/images/docs@2x.png b/assets/images/docs@2x.png index c740162c..e5122bd8 100644 Binary files a/assets/images/docs@2x.png and b/assets/images/docs@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 37c6c8fb..e61a924f 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2016-12-04", - "New documentations: SQLite and Codeception" + "New documentations: SQLite, Codeception and CodeceptJS" ], [ "2016-11-20", "New documentations: Yarn, Immutable.js and Async" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 1e8ef751..816b3cd9 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -159,6 +159,11 @@ credits = [ '2011-2016 Michael Bodnarchuk and contributors', 'MIT', 'https://raw.githubusercontent.com/Codeception/Codeception/master/LICENSE' + ], [ + 'CodeceptJS', + '2015 DavertMik', + 'MIT', + 'https://raw.githubusercontent.com/Codeception/CodeceptJS/master/LICENSE' ], [ 'CodeIgniter', '2014-2016 British Columbia Institute of Technology', diff --git a/assets/javascripts/views/pages/codeceptjs.coffee b/assets/javascripts/views/pages/codeceptjs.coffee deleted file mode 100644 index 18bb626e..00000000 --- a/assets/javascripts/views/pages/codeceptjs.coffee +++ /dev/null @@ -1,9 +0,0 @@ -#= 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 diff --git a/assets/javascripts/views/pages/simple.coffee b/assets/javascripts/views/pages/simple.coffee index 2a1fe24a..da5048a1 100644 --- a/assets/javascripts/views/pages/simple.coffee +++ b/assets/javascripts/views/pages/simple.coffee @@ -15,6 +15,7 @@ app.views.CPage = app.views.CakephpPage = app.views.ChaiPage = app.views.CodeceptionPage = +app.views.CodeceptjsPage = app.views.CoffeescriptPage = app.views.CordovaPage = app.views.CrystalPage = diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index 68c6350d..23884a92 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -40,7 +40,6 @@ 'pages/cakephp', 'pages/clojure', 'pages/codeception', - 'pages/codeceptjs', 'pages/coffeescript', 'pages/cordova', 'pages/crystal', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 90ffb5c0..bfa6cf8c 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -40,7 +40,6 @@ 'pages/cakephp', 'pages/clojure', 'pages/codeception', - 'pages/codeceptjs', 'pages/coffeescript', 'pages/cordova', 'pages/crystal', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 8798ef36..c09dbab9 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -56,6 +56,7 @@ %icon-close-white { background-position: -2rem -5rem; } %icon-back { background-position: -3rem -5rem; @extend %darkIconFix !optional; } +._icon-codeceptjs:before { background-position: -3rem 0; } ._icon-codeception:before { background-position: -4rem 0; } ._icon-sqlite:before { background-position: -5rem 0; @extend %darkIconFix !optional; } ._icon-async:before { background-position: -6rem 0; @extend %darkIconFix !optional; } diff --git a/assets/stylesheets/pages/_codeceptjs.scss b/assets/stylesheets/pages/_codeceptjs.scss deleted file mode 100644 index a3916d90..00000000 --- a/assets/stylesheets/pages/_codeceptjs.scss +++ /dev/null @@ -1,3 +0,0 @@ -._codeceptjs { - @extend %simple; -} diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index f86fe1e4..03087924 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -20,6 +20,7 @@ ._apache_pig, ._bower, ._chai, +._codeceptjs, ._docker, ._fish, ._gnu, diff --git a/lib/docs/filters/codeceptjs/clean_html.rb b/lib/docs/filters/codeceptjs/clean_html.rb index 4d1d8485..0a574027 100644 --- a/lib/docs/filters/codeceptjs/clean_html.rb +++ b/lib/docs/filters/codeceptjs/clean_html.rb @@ -2,16 +2,29 @@ module Docs class Codeceptjs class CleanHtmlFilter < Filter def call - root_page? ? root : other - doc - end + if root_page? + doc.inner_html = ' ' + return doc + end - def root - doc.inner_html = ' ' - end + @doc = doc.at_css('div.reference div[role=main]') + + css('hr').remove + + unless at_css('h1') + at_css('h2').name = 'h1' + end + + unless at_css('h2') + css('h3').each { |node| node.name = 'h2' } + css('h4').each { |node| node.name = 'h3' } + end + + css('pre > code').each do |node| + node.parent['data-language'] = node['class'] if node['class'] + node.parent.content = node.parent.content + end - def other - @doc = doc.at_css('div.reference').xpath('//div[@role="main"]') doc end end diff --git a/lib/docs/filters/codeceptjs/entries.rb b/lib/docs/filters/codeceptjs/entries.rb index 2927d094..b8b9ef94 100644 --- a/lib/docs/filters/codeceptjs/entries.rb +++ b/lib/docs/filters/codeceptjs/entries.rb @@ -2,26 +2,29 @@ module Docs class Codeceptjs class EntriesFilter < Docs::EntriesFilter def get_name - (at_css('h1') || at_css('h2')).content + at_css('h1').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 + if subpath == 'helpers/' + 'Helpers' + elsif subpath.start_with?('helpers') + "Helpers: #{name}" + elsif subpath.in? %w(commands/ configuration/ reports/ translation/) + 'Reference' + else + 'Guide' + end end def additional_entries - return [] unless type =~ /Helpers::.*/ + return [] unless subpath.start_with?('helpers') && subpath != 'helpers/' - helper = type.sub(/Helpers::/, '')+ '::' - - css('h2').map do |node| + css('h2').each_with_object [] do |node, entries| next if node['id'] == 'access-from-helpers' - [helper + node.content, node['id']] - end.compact + entries << ["#{node.content} (#{name})", node['id']] + end end - end end end diff --git a/lib/docs/scrapers/codeceptjs.rb b/lib/docs/scrapers/codeceptjs.rb index 8aa2a562..d44ffd36 100644 --- a/lib/docs/scrapers/codeceptjs.rb +++ b/lib/docs/scrapers/codeceptjs.rb @@ -3,7 +3,7 @@ module Docs self.name = 'CodeceptJS' self.type = 'codeceptjs' self.root_path = 'index.html' - self.release = '0.4' + self.release = '0.4.9' self.base_url = 'http://codecept.io/' self.links = { home: 'http://codecept.io/', @@ -14,11 +14,11 @@ module Docs options[:root_title] = 'CodeceptJS' options[:title] = false - options[:skip_links] = ->(filter) { !filter.initial_page? } - options[:skip_patterns] = [/changelog/, /quickstart$/] + options[:skip_links] = ->(filter) { !filter.root_page? } + options[:skip_patterns] = [/changelog/, /quickstart\z/] options[:attribution] = <<-HTML - © 2015–2016 Michael Bodnarchuk and Contributors
+ © 2015 DavertMik <davert@codegyre.com> (http://codegyre.com)
Licensed under the MIT License. HTML end diff --git a/public/icons/docs/codeceptjs/16.png b/public/icons/docs/codeceptjs/16.png index 4be32d5e..fb01c25b 100644 Binary files a/public/icons/docs/codeceptjs/16.png and b/public/icons/docs/codeceptjs/16.png differ diff --git a/public/icons/docs/codeceptjs/16@2x.png b/public/icons/docs/codeceptjs/16@2x.png index 119b2df2..6e7db2f7 100644 Binary files a/public/icons/docs/codeceptjs/16@2x.png and b/public/icons/docs/codeceptjs/16@2x.png differ