Browse Source

Use browserify to build demo

pull/104/head
Vitaly Puzrin 10 years ago
parent
commit
858475af7a
  1. 13
      Makefile
  2. 10
      support/demo_template/index.jade
  3. 38
      support/demo_template/index.js

13
Makefile

@ -24,19 +24,8 @@ demo: lint
> ./demo/index.css > ./demo/index.css
rm -rf ./support/demo_template/sample.json rm -rf ./support/demo_template/sample.json
browserify ./ -s markdownit > ./demo/markdown-it.js browserify ./ -s markdownit > ./demo/markdown-it.js
#cp ./dist/markdown-it.js ./demo/ browserify ./support/demo_template/index.js > ./demo/index.js
cp ./support/demo_template/index.js ./demo/
cp ./support/demo_template/README.md ./demo/ cp ./support/demo_template/README.md ./demo/
mkdir ./demo/plugins
cp ./node_modules/markdown-it-abbr/dist/* ./demo/plugins
cp ./node_modules/markdown-it-container/dist/* ./demo/plugins
cp ./node_modules/markdown-it-deflist/dist/* ./demo/plugins
cp ./node_modules/markdown-it-emoji/dist/* ./demo/plugins
cp ./node_modules/markdown-it-footnote/dist/* ./demo/plugins
cp ./node_modules/markdown-it-ins/dist/* ./demo/plugins
cp ./node_modules/markdown-it-mark/dist/* ./demo/plugins
cp ./node_modules/markdown-it-sub/dist/* ./demo/plugins
cp ./node_modules/markdown-it-sup/dist/* ./demo/plugins
gh-demo: demo gh-demo: demo
touch ./demo/.nojekyll touch ./demo/.nojekyll

10
support/demo_template/index.jade

@ -20,16 +20,6 @@ html
script(src='markdown-it.js') script(src='markdown-it.js')
script(src='https://twemoji.maxcdn.com/twemoji.min.js') script(src='https://twemoji.maxcdn.com/twemoji.min.js')
script(src='plugins/markdown-it-abbr.js')
script(src='plugins/markdown-it-container.js')
script(src='plugins/markdown-it-deflist.js')
script(src='plugins/markdown-it-emoji.js')
script(src='plugins/markdown-it-footnote.js')
script(src='plugins/markdown-it-ins.js')
script(src='plugins/markdown-it-mark.js')
script(src='plugins/markdown-it-sub.js')
script(src='plugins/markdown-it-sup.js')
link(rel='stylesheet' href='index.css') link(rel='stylesheet' href='index.css')
script(src='index.js') script(src='index.js')

38
support/demo_template/index.js

@ -1,4 +1,3 @@
(function () {
'use strict'; 'use strict';
/*eslint-env browser*/ /*eslint-env browser*/
@ -59,25 +58,25 @@
mdSrc = window.markdownit('commonmark'); mdSrc = window.markdownit('commonmark');
} else { } else {
mdHtml = window.markdownit(defaults) mdHtml = window.markdownit(defaults)
.use(window.markdownitAbbr) .use(require('markdown-it-abbr'))
.use(window.markdownitContainer, 'warning') .use(require('markdown-it-container'), 'warning')
.use(window.markdownitDeflist) .use(require('markdown-it-deflist'))
.use(window.markdownitEmoji) .use(require('markdown-it-emoji'))
.use(window.markdownitFootnote) .use(require('markdown-it-footnote'))
.use(window.markdownitIns) .use(require('markdown-it-ins'))
.use(window.markdownitMark) .use(require('markdown-it-mark'))
.use(window.markdownitSub) .use(require('markdown-it-sub'))
.use(window.markdownitSup); .use(require('markdown-it-sup'));
mdSrc = window.markdownit(defaults) mdSrc = window.markdownit(defaults)
.use(window.markdownitAbbr) .use(require('markdown-it-abbr'))
.use(window.markdownitContainer, 'warning') .use(require('markdown-it-container'), 'warning')
.use(window.markdownitDeflist) .use(require('markdown-it-deflist'))
.use(window.markdownitEmoji) .use(require('markdown-it-emoji'))
.use(window.markdownitFootnote) .use(require('markdown-it-footnote'))
.use(window.markdownitIns) .use(require('markdown-it-ins'))
.use(window.markdownitMark) .use(require('markdown-it-mark'))
.use(window.markdownitSub) .use(require('markdown-it-sub'))
.use(window.markdownitSup); .use(require('markdown-it-sup'));
} }
// Beautify output of parser for html content // Beautify output of parser for html content
@ -404,4 +403,3 @@
updateResult(); updateResult();
}); });
})();

Loading…
Cancel
Save