diff --git a/CHANGELOG.md b/CHANGELOG.md index d046643..c306b01 100644 --- a/CHANGELOG.md +++ b/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. diff --git a/Makefile b/Makefile index 9e31244..648b421 100644 --- a/Makefile +++ b/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 diff --git a/README.md b/README.md index d5d5683..a65079c 100644 --- a/README.md +++ b/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) diff --git a/package.json b/package.json index 10f07fd..3b8d3ee 100644 --- a/package.json +++ b/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", diff --git a/support/demo_template/index.jade b/support/demo_template/index.jade index 6124ff3..614952f 100644 --- a/support/demo_template/index.jade +++ b/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') diff --git a/support/demo_template/index.js b/support/demo_template/index.js index e74a4d0..8981cb1 100644 --- a/support/demo_template/index.js +++ b/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 diff --git a/support/demo_template/sample.md b/support/demo_template/sample.md index 6690f99..3eaa77c 100644 --- a/support/demo_template/sample.md +++ b/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 + + +### [\](https://www.npmjs.com/packages/markdown-it-ins) + +++Inserted text++ + + +### [\](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.