marked-admonition-extension
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.1 • Public • Published

    marked-admonition-extension

    an admonition extension for marked, both support ESM and CJS.

    Usage

    you can use abstractattentionbugcautiondangererrorexamplefailurehintinfonotequestionquotesuccesstipwarning as their theme;

    the below code can be used in node.js, base CommonJs.

    const { marked } = require('marked');
    const admonition = require('marked-admonition-extension');
    
    // import the css file
    require('marked/index.css');
    
    marked.use(admonition.default);
    
    const content = marked.parse(`!!! info Publish ESM and CJS in a single package
    In the past decade, due to the lack of a standard module system of \`JavaScript\`, **CommonJS** (a.k.a the \`require('xxx')\` and \`module.exports\` syntax) has been the way how Node.js and NPM packages work. Until 2015, when ECMAScript modules finally show up as the standard solution, the community start migrating to native ESM gradually.
    !!!`);
    
    console.log(content);

    it will output

    <div class="admonition admonition-info">
        <p class="admonition-title">Publish ESM and CJS in a single package</p>
        <p>In the past decade, due to the lack of a standard module system of <code>JavaScript</code>, <strong>CommonJS</strong> (a.k.a the <code>require(&#39;xxx&#39;)</code> and <code>module.exports</code> syntax) has been the way how Node.js and NPM packages work. Until 2015, when ECMAScript modules finally show up as the standard solution, the community start migrating to native ESM gradually.</p>
    
        </div>

    Demo

    Checkout the demo page to see marked in action ⛹️. Or you can edit and view preview result in markdown editor.

    License

    Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)

    Install

    npm i marked-admonition-extension

    DownloadsWeekly Downloads

    23

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    31.6 kB

    Total Files

    8

    Last publish

    Collaborators

    • xiefucai