Skip to content

breeze2/markdown-it-all

Repository files navigation

npm version Build Status Coverage Status

markdown-it-all

An integration of markdown-it and plugins.

Install

$ yarn add markdown-it-all

Usage

Sample

import MarkdownIt, { markdownItAll, markdownItCustom } from '../index'

const content = '# markdown-it rulezz!\n'
let md = new MarkdownIt()
let html = md.render(content)
console.log(html)
// '<h1>markdown-it rulezz!</h1>\n'

md = markdownItAll()
html = md.render(content)
console.log(html)
// '<h1 id="markdown-it-rulezz" data-source-line="1"><a class="anchor" href="#markdown-it-rulezz"><span class="octicon octicon-link"></span></a>markdown-it rulezz!</h1>\n'

md = markdownItCustom({sourceMap: true})
html = md.render(content)
console.log(html)
// '<h1 data-source-line="1">markdown-it rulezz!</h1>\n'

Interface

interface ICustomPlugins {
    abbreviation?: true,
    customContainer?: string[],
    definitionList?: true,
    emoji?: true,
    footnote?: true,
    githubToc?: IMarkdownItGithubTocOptions,
    insert?: true,
    latex?: true,
    mark?: true,
    mermaid?: true,
    sourceMap?: true,
    subscript?: true,
    superscript?: true,
    taskList?: true,
}
function markdownItCustom (plugins: ICustomPlugins, md?: MarkdownIt, mdOptions?: MarkdownIt.Options): MarkdownIt

Plugins

Support List

License

MIT