0.1.0 • Published 3 years ago

luna-markdown-viewer v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Luna Markdown Viewer

Live markdown renderer.

Demo

https://luna.liriliri.io/?path=/story/markdown-viewer

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-syntax-highlighter/luna-syntax-highlighter.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-markdown-viewer/luna-markdown-viewer.css" />
<script src="//cdn.jsdelivr.net/npm/luna-syntax-highlighter/luna-syntax-highlighter.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-markdown-viewer/luna-markdown-viewer.js"></script>

You can also get it on npm.

npm install luna-markdown-viewer luna-syntax-highlighter --save
import 'luna-syntax-highlighter/luna-syntax-highlighter.css'
import 'luna-markdown-viewer/luna-markdown-viewer.css'
import LunaMarkdownViewer from 'luna-markdown-viewer'

Usage

const markdownViewer = new LunaMarkdownViewer(container)
markdownViewer.setOption({ markdown: '# h1' })

Configuration

  • markdown(string): Markdown text to render.
0.1.0

3 years ago