smarkdown
Version:
Markdown parser, simplicity and extensibility.
76 lines (53 loc) • 4.43 kB
Markdown
<div align="center">
<div>
<img width="300" src="https://github.com/yahtnif/static/raw/master/logo/smarkdown.svg?sanitize=true" alt="smarkdown">
</div>
</div>
[](https://www.npmjs.com/package/smarkdown)
[](https://cdn.jsdelivr.net/npm/smarkdown/dist/smarkdown.min.js)
[](https://packagephobia.now.sh/result?p=smarkdown)
[](https://www.npmjs.com/package/smarkdown)
[](https://travis-ci.org/yahtnif/smarkdown)
[](https://github.com/996icu/996.ICU/blob/master/LICENSE)
> Markdown parser, simplicity and extensibility. Fork of [marked](https://github.com/markedjs/marked) and [marked-ts](https://github.com/KostyaTretyak/marked-ts).
## Features
- **Awesome:** ES6, TypeScript, Rollup, Jest...
- **Extensible:** Add your own [extensions](docs/extension.md)
- **Fast:** Low-level compiler for parsing markdown without caching or blocking for long periods of time
- **Lightweight:** It's 10kb of minified and gzipped
## Install
```sh
yarn add smarkdown
# or
npm install smarkdown
```
**browser (CDN):** [jsDelivr](https://www.jsdelivr.com/package/npm/smarkdown) | [unpkg](https://unpkg.com/smarkdown/)
## Usage
Import the library as a module:
```js
const Smarkdown = require('smarkdown');
```
Or import the library with a script tag:
```html
<script src="https://cdn.jsdelivr.net/npm/smarkdown/dist/smarkdown.min.js"></script>
```
Example:
```js
const str = 'I am using **Smarkdown**.';
console.log(Smarkdown.parse(str));
// <p>I am using <strong>Smarkdown</strong>.</p>
console.log(Smarkdown.parse(str, { nop: true }));
// I am using <strong>Smarkdown</strong>.
```
## More
- [Syntax highlighting](docs/syntax-highlighting.md)
- [Options](docs/options.md)
- [Extension](docs/extension.md)
- [Renderer](docs/renderer.md)
## Comparison
| | Smarkdown | Marked | markdown-it |
| :----------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Version | [](https://www.npmjs.com/package/smarkdown) | [](https://www.npmjs.com/package/marked) | [](https://www.npmjs.com/package/markdown-it) |
| Minified & Gzipped | [](https://cdn.jsdelivr.net/npm/smarkdown/dist/smarkdown.min.js) | [](https://cdn.jsdelivr.net/npm/marked/marked.min.js) | [](https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js) |
## License
[Anti 996](./LICENSE)