1.4.0 • Published 4 years ago

yirous-markdown v1.4.0

Weekly downloads
13
License
MIT
Repository
-
Last release
4 years ago

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

keydesc
MarkdownItthe option of markdown-it
MarkdownItSubthe option of markdown-it-sub
MarkdownItSupthe option of markdown-it-sup
MarkdownItAnchorthe option of markdown-it-anchor
MarkdownItTableOfContentsthe option of markdown-it-table-of-contents
MarkdownItContainerthe option of markdown-it-container

you can find those markdown-it plugins's options through npm search