@nonbili/posthtml-md-element

    0.1.0 • Public • Published

    posthtml-md-element

    A plugin for PostHTML to render markdown file into html.

    Differences from other PostHTML markdown plugins

    • markdown-it is used instead of marked
    • a dash is included in the element name <posthtml-md>, which follows the naming convention of custom element

    Install

    yarn add --dev @nonbili/posthtml-md-element
    

    Usage

    HTML

    <body>
      <posthtml-md src="docs/element.html"></posthtml-md>
    </body>

    NodeJS

    posthtml()
      .use(require("@nonbili/posthtml-md-element")())
      .process(html)
      .then((result) => console.log(result.html))

    Or postcss.config.js

    module.exports = {
      plugins: {
        "@nonbili/posthtml-md-element": {
        }
      }
    }

    Optional Configs

    • root: root path. Default to ./
    • encoding: default to utf-8
    • withMd: a function (md: MarkdownIt) => () to further customize MarkdownIt.

    All other options are passed to markdown-it.

    Install

    npm i @nonbili/posthtml-md-element

    DownloadsWeekly Downloads

    1

    Version

    0.1.0

    License

    BSD-3-Clause

    Unpacked Size

    4.05 kB

    Total Files

    4

    Last publish

    Collaborators

    • rnons