marked-note-extension
v0.1.5
Published
an note extension for marked.
Downloads
11
Maintainers
Readme
marked-note-extension
An note extension for marked.
Usage
you can use info
danger
warning
success
note
as their theme;
import { marked } from "marked";
// any name, just like `markedNote`
import markedNote from "marked-note-extension";
marked.use(markedNote);
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);
in markdown:
!!! 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.
!!!
Output:
<div class="note note-info">
<p class="note-title">Publish ESM and CJS in a single package</p>
<div class="note-body">
<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('xxx')</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>
</div>
reference resources
- marked-admonition-extension - 该库下载不了,还会破坏运行环境,我不知道为啥;于是就写了这个库,核心代码是 marked-admonition-extension 的源码