An open API service indexing awesome lists of open source software.

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

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.