Browse Source

Added custom container plugin demo

pull/82/head
Vitaly Puzrin 10 years ago
parent
commit
404c78290a
  1. 1
      Makefile
  2. 1
      package.json
  3. 1
      support/demo_template/index.jade
  4. 2
      support/demo_template/index.js
  5. 6
      support/demo_template/index.styl
  6. 6
      support/demo_template/sample.md

1
Makefile

@ -29,6 +29,7 @@ demo: lint
cp ./support/demo_template/README.md ./demo/ cp ./support/demo_template/README.md ./demo/
mkdir ./demo/plugins mkdir ./demo/plugins
cp ./node_modules/markdown-it-abbr/dist/* ./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-deflist/dist/* ./demo/plugins
cp ./node_modules/markdown-it-emoji/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-footnote/dist/* ./demo/plugins

1
package.json

@ -37,6 +37,7 @@
"istanbul": "*", "istanbul": "*",
"jade": "~1.9.2", "jade": "~1.9.2",
"markdown-it-abbr": "^1.0.0", "markdown-it-abbr": "^1.0.0",
"markdown-it-container": "^1.0.0",
"markdown-it-deflist": "^1.0.0", "markdown-it-deflist": "^1.0.0",
"markdown-it-emoji": "^1.0.0", "markdown-it-emoji": "^1.0.0",
"markdown-it-footnote": "^1.0.0", "markdown-it-footnote": "^1.0.0",

1
support/demo_template/index.jade

@ -21,6 +21,7 @@ html
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-abbr.js')
script(src='plugins/markdown-it-container.js')
script(src='plugins/markdown-it-deflist.js') script(src='plugins/markdown-it-deflist.js')
script(src='plugins/markdown-it-emoji.js') script(src='plugins/markdown-it-emoji.js')
script(src='plugins/markdown-it-footnote.js') script(src='plugins/markdown-it-footnote.js')

2
support/demo_template/index.js

@ -60,6 +60,7 @@
} else { } else {
mdHtml = window.markdownit(defaults) mdHtml = window.markdownit(defaults)
.use(window.markdownitAbbr) .use(window.markdownitAbbr)
.use(window.markdownitContainer, 'warning')
.use(window.markdownitDeflist) .use(window.markdownitDeflist)
.use(window.markdownitEmoji) .use(window.markdownitEmoji)
.use(window.markdownitFootnote) .use(window.markdownitFootnote)
@ -69,6 +70,7 @@
.use(window.markdownitSup); .use(window.markdownitSup);
mdSrc = window.markdownit(defaults) mdSrc = window.markdownit(defaults)
.use(window.markdownitAbbr) .use(window.markdownitAbbr)
.use(window.markdownitContainer, 'warning')
.use(window.markdownitDeflist) .use(window.markdownitDeflist)
.use(window.markdownitEmoji) .use(window.markdownitEmoji)
.use(window.markdownitFootnote) .use(window.markdownitFootnote)

6
support/demo_template/index.styl

@ -89,6 +89,12 @@ body
.footnotes-list .footnotes-list
padding-left 2em padding-left 2em
// custom container
.warning
background-color #ff8
padding 20px
border-radius 6px
.gh-ribbon .gh-ribbon
display block display block
position absolute position absolute

6
support/demo_template/sample.md

@ -237,3 +237,9 @@ This is HTML abbreviation example.
It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on. It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.
*[HTML]: Hyper Text Markup Language *[HTML]: Hyper Text Markup Language
### [Custom containers](https://github.com/markdown-it/markdown-it-container)
::: warning
*here be dragons*
:::

Loading…
Cancel
Save