Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/can-dy-jack/marked-note-extension
- Owner: can-dy-jack
- License: mit
- Created: 2022-10-26T07:01:31.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-26T10:53:12.000Z (about 2 years ago)
- Last Synced: 2024-10-11T01:51:31.495Z (28 days ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 therequire('xxx')
andmodule.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 的源码