From 9473067cc0eda8b1ba905dc2be18b06b717b8af3 Mon Sep 17 00:00:00 2001 From: Dave Thompson Date: Tue, 20 Mar 2012 17:08:02 -0600 Subject: [PATCH] Added DocTest tab to main jsduck page. --- Rakefile | 28 +++ lib/jsduck/app_data.rb | 1 + lib/jsduck/options.rb | 6 + template/app/Application.js | 3 +- template/app/Assert.js | 17 ++ template/app/History.js | 5 +- template/app/controller/Content.js | 2 +- template/app/controller/DocTests.js | 148 +++++++++++++ template/app/controller/InlineExamples.js | 12 +- template/app/controller/Tabs.js | 7 +- template/app/model/DocTest.js | 15 ++ template/app/view/Viewport.js | 7 +- template/app/view/doctests/Index.js | 224 ++++++++++++++++++++ template/app/view/examples/Inline.js | 43 +++- template/app/view/examples/InlinePreview.js | 77 +++++-- template/eg-iframe.html | 9 +- template/resources/sass/_doc_tests.scss | 24 +++ template/resources/sass/viewport.scss | 3 + 18 files changed, 595 insertions(+), 36 deletions(-) create mode 100644 template/app/Assert.js create mode 100644 template/app/controller/DocTests.js create mode 100644 template/app/model/DocTest.js create mode 100644 template/app/view/doctests/Index.js create mode 100644 template/resources/sass/_doc_tests.scss diff --git a/Rakefile b/Rakefile index fe4a4faa..ff2e121e 100644 --- a/Rakefile +++ b/Rakefile @@ -187,6 +187,19 @@ class JsDuckRunner ] end + def add_doctest + @options += [ + "--title", "Sencha Docs - Ext JS 4.0", + "--footer", "Ext JS 4.0 Docs - Generated with JSDuck VERSION. Terms of Use", + "--ignore-global", + "--images", "#{OUT_DIR}/docs/doc-resources", + "--local-storage-db", "ext-4", + "--output", "#{OUT_DIR}", + "#{EXT_BUILD}/src", + "--doctests" + ] + end + def add_phone_redirect @options += ["--body-html", <<-EOHTML] - + + + diff --git a/template/resources/sass/_doc_tests.scss b/template/resources/sass/_doc_tests.scss new file mode 100644 index 00000000..d417920b --- /dev/null +++ b/template/resources/sass/_doc_tests.scss @@ -0,0 +1,24 @@ +// Styles for doc tests +.doc-test-preview { + display: none; +} + +.doc-test-ready { + font-weight: bold; + color: #333; +} + +.doc-test-error { + font-weight: bold; + color: orange; +} + +.doc-test-failure { + font-weight: bold; + color: red; +} + +.doc-test-success { + font-weight: bold; + color: green; +} \ No newline at end of file diff --git a/template/resources/sass/viewport.scss b/template/resources/sass/viewport.scss index b47f9d82..43787922 100644 --- a/template/resources/sass/viewport.scss +++ b/template/resources/sass/viewport.scss @@ -147,3 +147,6 @@ p.screenshot { // Welcome Pages @import "extjs_welcome"; @import "touch_welcome"; + +// Doc Tests +@import "doc_tests"; -- GitLab