Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/can-dy-jack/marked-note-extension

an note extension for marked.
https://github.com/can-dy-jack/marked-note-extension

Last synced: 6 days ago
JSON representation

an note extension for marked.

Awesome Lists containing this project

README

        

# marked-note-extension
An note extension for marked.

## Usage

you can use `info` `danger` `warning` `success` `note` as their theme;

```js
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:
```text
!!! 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:
```html


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.




```

## reference resources
- [marked-admonition-extension](https://github.com/xiefucai/marked-admonition-extension) - 该库下载不了,还会破坏运行环境,我不知道为啥;于是就写了这个库,核心代码是 marked-admonition-extension 的源码