0.0.1 • Published 8 months ago

wc-mdit v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

wc-mdit

A markdown-to-html web component.

⚙️ Installation

  • npm

npm i wc-mdit
  • scripts

<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/wc-mdit.umd.js"></script>

🚀 Example

import 'wc-mdit'

function App() {
  return (
    <wc-mdit content='# H1' theme='github-dark' />
    // or
    <wc-mdit src="https://raw.githubusercontent.com/huodoushigemi/wc-mdit/refs/heads/main/README.md" theme='github-dark' />
  )
}

📄 Props

AttributeTypeDescription
srcStringURL to external markdown file.
contentString
themeString
cssString<style>{css}</style>
no-shadowBooleanIf set, renders and stamps into light DOM instead. Please know what you are doing.
body-classStringClass names forwarded to .markdown-body block.
body-styleStringStyle forwarded to .markdown-body block.
optionsObjectnew MarkdownIt(options)
0.0.1

8 months ago

0.0.0

8 months ago