1.4.0 • Published 4 years ago
yirous-markdown v1.4.0
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.YirousMarkdown
Base On NPM
npm i yirous-markdown -S
import 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