yirous-markdown
v1.4.0
Published
A Markdown Component Base On Pure Javascript
Readme
yirous-markdown
A Markdown Component Base On Pure Javascript
Online Demo
http://yirous.gitee.io/yirous-markdown/
Install
Base On Browser
yirous-markdown.js and yirous-markdown.css
const YirousMarkdown = window.YirousMarkdownBase On NPM
npm i yirous-markdown -Simport YirousMarkdown from 'yirous-markdown'Usage
Basic Usage
const text = `
# First Level Title
this is a brief introduction of yirous-markdown
`.trim()
const markdownEl = YirousMarkdown().render(text)
document.body.appendChild(markdownEl)
YirousMarkdown is a function, the first parameter is an option
|key|desc| | --- | --- | | MarkdownIt | the option of markdown-it | | MarkdownItSub | the option of markdown-it-sub | | MarkdownItSup | the option of markdown-it-sup | | MarkdownItAnchor | the option of markdown-it-anchor | | MarkdownItTableOfContents | the option of markdown-it-table-of-contents | | MarkdownItContainer | the option of markdown-it-container |
you can find those markdown-it plugins's options through npm search
