From 941f63483d6bb647a87338312dd612d92b28a1be Mon Sep 17 00:00:00 2001 From: Vit Brunner Date: Tue, 11 Jun 2013 21:47:05 +0100 Subject: [PATCH] From Middleman to DocPad --- .gitignore | 3 +- .travis.yml | 8 +- Gemfile | 4 - Gemfile.lock | 104 ------------------ Makefile | 14 ++- config.rb | 8 -- docpad.coffee | 4 + package.json | 4 + source/_scripts.haml | 9 -- source/documents/_scripts.html.jade | 9 ++ source/documents/index.html.jade | 14 +++ .../scripts/app.js.coffee} | 0 .../scripts/controllers.js.coffee} | 0 .../scripts/reader/json.js.coffee} | 0 .../scripts/reader/markdown.js.coffee} | 0 .../scripts/services.js.coffee} | 0 .../scripts/tests/reader/_abstract.js.coffee} | 0 .../scripts/tests/reader/json.js.coffee} | 0 .../scripts/tests/reader/markdown.js.coffee} | 0 source/documents/styles/style.css.less | 3 + source/documents/tests.html.jade | 17 +++ source/index.haml | 14 --- source/styles/style.sass | 2 - source/tests.haml | 16 --- 24 files changed, 67 insertions(+), 166 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 config.rb create mode 100644 docpad.coffee delete mode 100644 source/_scripts.haml create mode 100644 source/documents/_scripts.html.jade create mode 100644 source/documents/index.html.jade rename source/{scripts/app.coffee => documents/scripts/app.js.coffee} (100%) rename source/{scripts/controllers.coffee => documents/scripts/controllers.js.coffee} (100%) rename source/{scripts/reader/json.coffee => documents/scripts/reader/json.js.coffee} (100%) rename source/{scripts/reader/markdown.coffee => documents/scripts/reader/markdown.js.coffee} (100%) rename source/{scripts/services.coffee => documents/scripts/services.js.coffee} (100%) rename source/{scripts/tests/reader/_abstract.coffee => documents/scripts/tests/reader/_abstract.js.coffee} (100%) rename source/{scripts/tests/reader/json.coffee => documents/scripts/tests/reader/json.js.coffee} (100%) rename source/{scripts/tests/reader/markdown.coffee => documents/scripts/tests/reader/markdown.js.coffee} (100%) create mode 100644 source/documents/styles/style.css.less create mode 100644 source/documents/tests.html.jade delete mode 100644 source/index.haml delete mode 100644 source/styles/style.sass delete mode 100644 source/tests.haml diff --git a/.gitignore b/.gitignore index d744fa1..01add65 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/.sass-cache /build /node_modules -/source/data +/source/files diff --git a/.travis.yml b/.travis.yml index 4674c20..a23078a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,8 @@ node_js: - 0.10 before_script: - - bundle - - npm install + - make run & + - sleep 5 script: - - middleman & - - sleep 5 - - node_modules/.bin/phantomjs node_modules/qunitjs/addons/phantomjs/runner.js http://0.0.0.0:4567/tests.html + - make test diff --git a/Gemfile b/Gemfile deleted file mode 100644 index e534c4a..0000000 --- a/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'http://rubygems.org' - -gem "middleman", "~>3.0.13" -gem 'rb-inotify', '~> 0.9' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index d5b1a91..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,104 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.2.13) - i18n (= 0.6.1) - multi_json (~> 1.0) - chunky_png (1.2.8) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.3.3) - compass (0.12.2) - chunky_png (~> 1.2) - fssm (>= 0.2.7) - sass (~> 3.1) - execjs (1.4.0) - multi_json (~> 1.0) - ffi (1.8.1) - fssm (0.2.10) - haml (4.0.2) - tilt - hike (1.2.2) - http_router (0.10.2) - rack (>= 1.0.0) - url_mount (~> 0.2.1) - i18n (0.6.1) - listen (0.7.3) - maruku (0.6.1) - syntax (>= 1.0.0) - middleman (3.0.13) - middleman-core (= 3.0.13) - middleman-more (= 3.0.13) - middleman-sprockets (~> 3.0.8) - middleman-core (3.0.13) - activesupport (~> 3.2.6) - bundler (~> 1.1) - listen (~> 0.7.3) - rack (~> 1.4.1) - rack-test (~> 0.6.1) - rb-fsevent (~> 0.9.3) - thor (~> 0.15.4) - tilt (~> 1.3.6) - middleman-more (3.0.13) - coffee-script (~> 2.2.0) - coffee-script-source (~> 1.3.3) - compass (>= 0.12.2) - execjs (~> 1.4.0) - haml (>= 3.1.6) - i18n (~> 0.6.0, < 0.6.2) - maruku (~> 0.6.0) - middleman-core (= 3.0.13) - padrino-helpers (= 0.10.7) - sass (>= 3.1.20) - uglifier (~> 1.2.6) - middleman-sprockets (3.0.11) - middleman-more (>= 3.0.11) - sprockets (~> 2.1) - sprockets-sass (~> 0.9.1) - multi_json (1.7.3) - padrino-core (0.10.7) - activesupport (~> 3.2.0) - http_router (~> 0.10.2) - sinatra (~> 1.3.1) - thor (~> 0.15.2) - tilt (~> 1.3.0) - padrino-helpers (0.10.7) - i18n (~> 0.6) - padrino-core (= 0.10.7) - rack (1.4.5) - rack-protection (1.5.0) - rack - rack-test (0.6.2) - rack (>= 1.0) - rb-fsevent (0.9.3) - rb-inotify (0.9.0) - ffi (>= 0.5.0) - sass (3.2.9) - sinatra (1.3.6) - rack (~> 1.4) - rack-protection (~> 1.3) - tilt (~> 1.3, >= 1.3.3) - sprockets (2.9.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-sass (0.9.1) - sprockets (~> 2.0) - tilt (~> 1.1) - syntax (1.0.0) - thor (0.15.4) - tilt (1.3.7) - uglifier (1.2.7) - execjs (>= 0.3.0) - multi_json (~> 1.3) - url_mount (0.2.1) - rack - -PLATFORMS - ruby - -DEPENDENCIES - middleman (~> 3.0.13) - rb-inotify (~> 0.9) diff --git a/Makefile b/Makefile index a00474f..0f4a881 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,13 @@ default: - bundle - middleman build + npm install + node_modules/.bin/docpad generate + +run: + npm install + node_modules/.bin/docpad run + +test: + node_modules/.bin/phantomjs node_modules/qunitjs/addons/phantomjs/runner.js http://0.0.0.0:9778/tests.html + +clean: + rm -rf node_modules/ build/ diff --git a/config.rb b/config.rb deleted file mode 100644 index 10fcb8b..0000000 --- a/config.rb +++ /dev/null @@ -1,8 +0,0 @@ -set :css_dir, 'styles' -set :js_dir, 'scripts' - -Tilt.mappings.delete('md') - -configure :build do - activate :minify_css -end diff --git a/docpad.coffee b/docpad.coffee new file mode 100644 index 0000000..8bfc1ca --- /dev/null +++ b/docpad.coffee @@ -0,0 +1,4 @@ +module.exports = { + outPath: "build" + srcPath: "source" +} diff --git a/package.json b/package.json index a7bff17..61fe451 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,10 @@ "author": "Vit Brunner", "description": "Visual comparison of different translations of itemized texts; e.g. poems, bibles, etc.", "devDependencies": { + "docpad": "6.x", + "docpad-plugin-coffeescript": "2.x", + "docpad-plugin-jade": "2.x", + "docpad-plugin-less": "2.x", "qunitjs": "1.11.x", "phantomjs": "1.9.x" }, diff --git a/source/_scripts.haml b/source/_scripts.haml deleted file mode 100644 index 49d4aff..0000000 --- a/source/_scripts.haml +++ /dev/null @@ -1,9 +0,0 @@ -/ application scripts -#{javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.js"} -/ TODO use cdnjs.com once they serve marked -#{javascript_include_tag "//raw.github.com/chjj/marked/master/lib/marked.js"} -#{javascript_include_tag "app"} -#{javascript_include_tag "services"} -#{javascript_include_tag "reader/markdown"} -#{javascript_include_tag "reader/json"} -#{javascript_include_tag "controllers"} diff --git a/source/documents/_scripts.html.jade b/source/documents/_scripts.html.jade new file mode 100644 index 0000000..9d3437e --- /dev/null +++ b/source/documents/_scripts.html.jade @@ -0,0 +1,9 @@ +// application scripts +script(src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.js") +// TODO use cdnjs.com once they serve marked +script(src="//raw.github.com/chjj/marked/master/lib/marked.js") +script(src="scripts/app.js") +script(src="scripts/services.js") +script(src="scripts/reader/markdown.js") +script(src="scripts/reader/json.js") +script(src="scripts/controllers.js") diff --git a/source/documents/index.html.jade b/source/documents/index.html.jade new file mode 100644 index 0000000..98a6212 --- /dev/null +++ b/source/documents/index.html.jade @@ -0,0 +1,14 @@ +doctype 5 +html(ng-app="sideBySide") + head + title Side By Side viewer + meta(charset="utf-8") + link(rel="stylesheet", type="text/css", href="//fonts.googleapis.com/css?family=Titillium+Web:400,700,400italic,700italic") + link(rel="stylesheet", type="text/css", href="styles/style.css") + include _scripts.html.jade + + body + div(class="container", ng-controller="comparisonController") + div(class="verse", ng-repeat="verse in verses") + div(class="section", ng-bind="verse.section") + div(class="version", ng-repeat= "version in verse.versions") {{ version }} diff --git a/source/scripts/app.coffee b/source/documents/scripts/app.js.coffee similarity index 100% rename from source/scripts/app.coffee rename to source/documents/scripts/app.js.coffee diff --git a/source/scripts/controllers.coffee b/source/documents/scripts/controllers.js.coffee similarity index 100% rename from source/scripts/controllers.coffee rename to source/documents/scripts/controllers.js.coffee diff --git a/source/scripts/reader/json.coffee b/source/documents/scripts/reader/json.js.coffee similarity index 100% rename from source/scripts/reader/json.coffee rename to source/documents/scripts/reader/json.js.coffee diff --git a/source/scripts/reader/markdown.coffee b/source/documents/scripts/reader/markdown.js.coffee similarity index 100% rename from source/scripts/reader/markdown.coffee rename to source/documents/scripts/reader/markdown.js.coffee diff --git a/source/scripts/services.coffee b/source/documents/scripts/services.js.coffee similarity index 100% rename from source/scripts/services.coffee rename to source/documents/scripts/services.js.coffee diff --git a/source/scripts/tests/reader/_abstract.coffee b/source/documents/scripts/tests/reader/_abstract.js.coffee similarity index 100% rename from source/scripts/tests/reader/_abstract.coffee rename to source/documents/scripts/tests/reader/_abstract.js.coffee diff --git a/source/scripts/tests/reader/json.coffee b/source/documents/scripts/tests/reader/json.js.coffee similarity index 100% rename from source/scripts/tests/reader/json.coffee rename to source/documents/scripts/tests/reader/json.js.coffee diff --git a/source/scripts/tests/reader/markdown.coffee b/source/documents/scripts/tests/reader/markdown.js.coffee similarity index 100% rename from source/scripts/tests/reader/markdown.coffee rename to source/documents/scripts/tests/reader/markdown.js.coffee diff --git a/source/documents/styles/style.css.less b/source/documents/styles/style.css.less new file mode 100644 index 0000000..1c84a78 --- /dev/null +++ b/source/documents/styles/style.css.less @@ -0,0 +1,3 @@ +body { + font-family: "Titillium Web", sans-serif; +} diff --git a/source/documents/tests.html.jade b/source/documents/tests.html.jade new file mode 100644 index 0000000..cd2e585 --- /dev/null +++ b/source/documents/tests.html.jade @@ -0,0 +1,17 @@ +doctype 5 +html + head + title Side By Side test suite + meta(charset="utf-8") + + include _scripts.html.jade + + // test scripts + link(rel="stylesheet", type="text/css", href="//cdnjs.cloudflare.com/ajax/libs/qunit/1.11.0/qunit.css") + script(src="//cdnjs.cloudflare.com/ajax/libs/qunit/1.11.0/qunit.js") + script(src="scripts/tests/reader/_abstract.js") + script(src="scripts/tests/reader/markdown.js") + script(src="scripts/tests/reader/json.js") + + body + div(id="qunit") diff --git a/source/index.haml b/source/index.haml deleted file mode 100644 index b112495..0000000 --- a/source/index.haml +++ /dev/null @@ -1,14 +0,0 @@ -!!! 5 -%html{"ng-app" => "sideBySide"} - %head - %title Side By Side viewer - %meta{:charset => "utf-8"} - #{stylesheet_link_tag "//fonts.googleapis.com/css?family=Titillium+Web:400,700,400italic,700italic"} - #{stylesheet_link_tag "style"} - = render_partial 'scripts' - - %body - %div{:class => "container", "ng-controller" => "comparisonController"} - %div{:class => "verse", "ng-repeat" => "verse in verses"} - %div{:class => "section", "ng-bind" => "verse.section"} - %div{:class => "version", "ng-repeat" => "version in verse.versions"} {{ version }} diff --git a/source/styles/style.sass b/source/styles/style.sass deleted file mode 100644 index 1c2183f..0000000 --- a/source/styles/style.sass +++ /dev/null @@ -1,2 +0,0 @@ -body - font-family: "Titillium Web", sans-serif diff --git a/source/tests.haml b/source/tests.haml deleted file mode 100644 index 9791dbe..0000000 --- a/source/tests.haml +++ /dev/null @@ -1,16 +0,0 @@ -!!! 5 -%html - %head - %title Side By Side test suite - %meta{:charset => "utf-8"} - = render_partial 'scripts' - - / test scripts - #{stylesheet_link_tag "//cdnjs.cloudflare.com/ajax/libs/qunit/1.11.0/qunit.css"} - #{javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/qunit/1.11.0/qunit.js"} - #{javascript_include_tag "tests/reader/_abstract"} - #{javascript_include_tag "tests/reader/markdown"} - #{javascript_include_tag "tests/reader/json"} - - %body - %div{:id => "qunit"}