@skyone/markdown2html (1.0.0)

Published 2023-08-20 18:23:43 +08:00 by skyone-wzw in skyone-wzw/markdown-render

Installation

@skyone:registry=
npm install @skyone/markdown2html@1.0.0
"@skyone/markdown2html": "1.0.0"

About this package

@skyone/markdown2html

渲染 Markdown 到 HTML, 基于 unified, 包含定制的 tag.

import markdown2html from "@skyone/markdown2html";

const html = await markdown2html("# 123")

目前支持的自定义 Tags:

  • youtube

    ::youtube[A cute cat]{#0_hB1VvBtqY}
    

    最好配合下面的 CSS 使用

    .embed-youtube {
        height: auto;
        width: 100%;
        max-width: 560px;
        aspect-ratio: 16 / 9;
        display: block;
        margin: 0 auto;
    }
    
  • aplayer

    ::aplayer[Music player]{#N@4010201_N@3019706}
    

Dependencies

Development Dependencies

ID Version
@rollup/plugin-commonjs ^25.0.1
@rollup/plugin-node-resolve ^15.1.0
@rollup/plugin-replace ^5.0.2
@rollup/plugin-terser ^0.4.3
@types/node ^20.4.10
hastscript ^8.0.0
rehype-highlight ^6.0.0
rehype-katex ^6.0.3
rehype-stringify ^9.0.3
remark-directive ^2.0.1
remark-gfm ^3.0.1
remark-math ^5.1.1
remark-parse ^10.0.2
remark-rehype ^10.1.0
rollup ^3.25.1
rollup-plugin-polyfill-node ^0.12.0
rollup-plugin-typescript2 ^0.35.0
unified ^10.1.2
unist-util-visit ^5.0.0

Keywords

markdown render unified parser remark markdown-render
Details
npm
2023-08-20 18:23:43 +08:00
84
skyone-wzw
MIT
latest
705 KiB
Assets (1)
Versions (1) View all
1.0.0 2023-08-20