https://github.com/mb21/markdown-it-pandoc
Package bundling a few markdown-it plugins to approximate pandoc flavoured markdown
https://github.com/mb21/markdown-it-pandoc
markdown markdown-it
Last synced: over 1 year ago
JSON representation
Package bundling a few markdown-it plugins to approximate pandoc flavoured markdown
- Host: GitHub
- URL: https://github.com/mb21/markdown-it-pandoc
- Owner: mb21
- License: mit
- Created: 2018-11-26T11:55:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-21T07:14:13.000Z (over 1 year ago)
- Last Synced: 2025-03-21T07:15:14.604Z (over 1 year ago)
- Topics: markdown, markdown-it
- Language: JavaScript
- Size: 14.6 KB
- Stars: 14
- Watchers: 3
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-pandoc
Package bundling a few [markdown-it](https://github.com/markdown-it/markdown-it)
plugins to approximate [pandoc flavoured markdown](http://pandoc.org/MANUAL.html#pandocs-markdown).
For a demo, you can try [PanWriter](https://panwriter.com).
## Dependencies
This package requires a lot of peer dependencies, depending on which extensions you enable.
For up-to-date information, it is probably best to take a quick look at [the source](./index.js).
| Options | Plugin dependency |
|----------------------------------|------------------------------|
| `bracketed_spans` + `attributes` | markdown-it-bracketed-spans |
| `attributes` | markdown-it-attrs |
| `fenced_divs` + `attributes` | markdown-it-container |
| `definition lists` | markdown-it-deflist |
| `footnotes` | markdown-it-footnote |
| `implicit_figures` | markdown-it-implicit-figures |
| `grid_tables` | markdown-it-gridtables |
| `subscript` | markdown-it-sub |
| `superscript` | markdown-it-sup |
| `task_lists` | markdown-it-task-lists |
| `katex` | markdown-it-texmath, katex |
| `tex_math_dollars` | markdown-it-texmath, katex |
| `tex_math_single_backslash` | markdown-it-texmath, katex |
| `mathjax` | markdown-it-mathjax3 |
| `highlight` | markdown-it-highlightjs |
| `highlight_inline` | markdown-it-highlightjs |
## Usage
```javascript
var md = require('markdown-it')();
require('markdown-it-pandoc')(md);
md.render('my markdown string');
```
There is an optional second argument to enable/disable `markdown-it-pandoc` extensions. For example:
```javascript
var md = require('markdown-it')({ html: true });
require('markdown-it-pandoc')(md, { implicit_figures: false });
md.render('my markdown string');
```
Or using import syntax:
```javascript
import markdownIt from 'markdown-it'
import markdownItPandoc from 'markdown-it-pandoc'
const md = markdownItPandoc(
markdownIt({ html: true }),
{ implicit_figures: false }
);
md.render('my markdown string');
```
Note that MathJax and KaTeX are exclusive features.
You cannot set both options true.