Live markdown renderer.
https://luna.liriliri.io/?path=/story/markdown-viewer
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-carousel/luna-carousel.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.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-carousel/luna-carousel.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-gallery/luna-gallery.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-gallery luna-carousel luna-syntax-highlighter --save
import 'luna-syntax-highlighter/luna-syntax-highlighter.css'
import 'luna-carousel/luna-carousel.css'
import 'luna-gallery/luna-gallery.css'
import 'luna-markdown-viewer/luna-markdown-viewer.css'
import LunaMarkdownViewer from 'luna-markdown-viewer'
const markdownViewer = new LunaMarkdownViewer(container)
markdownViewer.setOption({ markdown: '# h1' })
- markdown(string): Markdown text to render.