From 9e5743008f001a0ad1079085ed6f9009dce97c08 Mon Sep 17 00:00:00 2001 From: Aleksey V Zapparov Date: Sat, 20 Dec 2014 02:48:34 +0100 Subject: [PATCH] Improve `make gh-pages` task Regenerates demo website: http://markdown-it.github.io/ --- .eslintignore | 1 + Makefile | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.eslintignore b/.eslintignore index 10f1f79..e07fb01 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,6 @@ benchmark/implementations/ coverage/ demo/sample.js +demo-web/ dist/ node_modules/ diff --git a/Makefile b/Makefile index 78cb43c..bf00831 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,19 @@ demo: lint stylus -u autoprefixer-stylus demo/assets/index.styl rm -rf demo/sample.json +gh-pages: browserify demo + rm -rf ./demo-web + cp -r ./demo ./demo-web + cp ./dist/markdown-it.js ./demo-web + sed -i "s|../dist|.|" ./demo-web/index.html + cd ./demo-web \ + && git init . \ + && git add . \ + && git commit -m "Auto-generate demo" \ + && git remote add origin git@github.com:markdown-it/markdown-it.github.io.git \ + && git push --force origin master + rm -rf ./demo-web + lint: eslint --reset ./ @@ -33,13 +46,6 @@ coverage: test-ci: lint istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage -gh-pages: - if [ "git branch --list gh-pages" ]; then \ - git branch -D gh-pages ; \ - fi - git branch gh-pages - git push origin gh-pages -f - publish: @if test 0 -ne `git status --porcelain | wc -l` ; then \ echo "Unclean working tree. Commit or stash changes first." >&2 ; \