Browse Source

Updated demo & sample to better show existing plugins

pull/30/head
Vitaly Puzrin 10 years ago
parent
commit
35c23bc678
  1. 2
      CHANGELOG.md
  2. 7
      Makefile
  3. 2
      README.md
  4. 9
      package.json
  5. 8
      support/demo_template/index.jade
  6. 18
      support/demo_template/index.js
  7. 40
      support/demo_template/sample.md

2
CHANGELOG.md

@ -7,7 +7,7 @@
- Added `md` (parser instance) link to all state objects (instead of former
options/parser).
- References/Footnotes/Abbrs moved to `block` chain.
- Input normalisation moved to `core` chain.
- Input normalization moved to `core` chain.
- Splitted links and images to separate rules.
- Renamed some rules.
- Removed `full` preset. Not needed anymore.

7
Makefile

@ -28,7 +28,14 @@ demo: lint
cp ./support/demo_template/index.js ./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-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
touch ./demo/.nojekyll

2
README.md

@ -170,7 +170,7 @@ Embedded (enabled by default):
- [Tables](https://help.github.com/articles/github-flavored-markdown/#tables) (GFM)
- [Strikethrough](https://help.github.com/articles/github-flavored-markdown/#strikethrough) (GFM)
Via plugins::
Via plugins:
- [subscript](https://github.com/markdown-it/markdown-it-sub)
- [superscript](https://github.com/markdown-it/markdown-it-sup)

9
package.json

@ -37,7 +37,14 @@
"eslint-plugin-nodeca": "^1.0.0",
"istanbul": "*",
"jade": "^1.6.0",
"markdown-it-emoji": "~ 0.1.0",
"markdown-it-abbr": "~ 0.1.0",
"markdown-it-deflist": "~ 0.1.0",
"markdown-it-emoji": "~ 0.1.3",
"markdown-it-footnote": "~ 0.1.0",
"markdown-it-ins": "~ 0.1.0",
"markdown-it-mark": "~ 0.1.0",
"markdown-it-sub": "~ 0.1.0",
"markdown-it-sup": "~ 0.1.0",
"markdown-it-testgen": "~ 0.1.0",
"marked": "0.3.2",
"stylus": "^0.49.1",

8
support/demo_template/index.jade

@ -19,7 +19,15 @@ html
script(src='markdown-it.js')
script(src='https://twemoji.maxcdn.com/twemoji.min.js')
script(src='plugins/markdown-it-abbr.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')
script(src='index.js')

18
support/demo_template/index.js

@ -59,9 +59,23 @@
mdSrc = window.markdownit('commonmark');
} else {
mdHtml = window.markdownit(defaults)
.use(window.markdownitEmoji);
.use(window.markdownitAbbr)
.use(window.markdownitDeflist)
.use(window.markdownitEmoji)
.use(window.markdownitFootnote)
.use(window.markdownitIns)
.use(window.markdownitMark)
.use(window.markdownitSub)
.use(window.markdownitSup);
mdSrc = window.markdownit(defaults)
.use(window.markdownitEmoji);
.use(window.markdownitAbbr)
.use(window.markdownitDeflist)
.use(window.markdownitEmoji)
.use(window.markdownitFootnote)
.use(window.markdownitIns)
.use(window.markdownitMark)
.use(window.markdownitSub)
.use(window.markdownitSup);
}
// Beautify output of parser for html content

40
support/demo_template/sample.md

@ -50,15 +50,7 @@ __This is bold text__
_This is italic text_
~~Deleted text~~
Superscript: 19^th^
Subscript: H~2~O
++Inserted text++
==Marked text==
~~Strikethrough~~
## Blockquotes
@ -165,7 +157,13 @@ With a reference later in the document defining the URL location:
[id]: https://octodex.github.com/images/dojocat.jpg "The Dojocat"
# Emojies (via [plugin](https://github.com/markdown-it/markdown-it-emoji))
## Plugins
The killer feature of `markdown-it` is very effective support of
[syntax plugins](https://www.npmjs.org/browse/keyword/markdown-it-plugin).
### [Emojies](https://github.com/markdown-it/markdown-it-emoji)
> Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:
>
@ -174,7 +172,23 @@ With a reference later in the document defining the URL location:
see [how to change output](https://github.com/markdown-it/markdown-it-emoji#change-output) with twemoji.
## Footnotes
### [Subscipt](https://www.npmjs.com/packages/markdown-it-sub) / [Superscirpt](https://www.npmjs.com/packages/markdown-it-sup)
- 19^th^
- H~2~O
### [\<ins>](https://www.npmjs.com/packages/markdown-it-ins)
++Inserted text++
### [\<mark>](https://www.npmjs.com/packages/markdown-it-mark)
==Marked text==
### [Footnotes](https://www.npmjs.com/packages/markdown-it-footnote)
Footnote 1 link[^first].
@ -191,7 +205,7 @@ Duplicated footnote reference[^second].
[^second]: Footnote text.
## Definition lists
### [Definition lists](https://www.npmjs.com/packages/markdown-it-deflist)
Term 1
@ -216,7 +230,7 @@ Term 2
~ Definition 2b
## Abbreviations
### [Abbreviations](https://www.npmjs.com/packages/markdown-it-abbr)
This is HTML abbreviation example.

Loading…
Cancel
Save