Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geekplux/markdown-it-fence
fence customize plugin for markdown-it
https://github.com/geekplux/markdown-it-fence
markdown markdown-it markdown-it-plugin
Last synced: 19 days ago
JSON representation
fence customize plugin for markdown-it
- Host: GitHub
- URL: https://github.com/geekplux/markdown-it-fence
- Owner: geekplux
- License: mit
- Created: 2017-03-21T08:54:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T10:38:07.000Z (almost 2 years ago)
- Last Synced: 2024-10-18T23:00:03.323Z (28 days ago)
- Topics: markdown, markdown-it, markdown-it-plugin
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 20
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-fence
[![NPM version](https://img.shields.io/npm/v/markdown-it-fence.svg?style=flat)](https://npmjs.com/package/markdown-it-fence) [![NPM downloads](https://img.shields.io/npm/dm/markdown-it-fence.svg?style=flat)](https://npmjs.com/package/markdown-it-fence) [![Build Status](https://img.shields.io/circleci/project/geekplux/markdown-it-fence/master.svg?style=flat)](https://circleci.com/gh/geekplux/markdown-it-fence) [![codecov](https://codecov.io/gh/geekplux/markdown-it-fence/branch/master/graph/badge.svg)](https://codecov.io/gh/geekplux/markdown-it-fence)
[![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](http://donate.geekplux.com)> fence customize plugin for markdown-it
## Install
```bash
yarn add markdown-it-fence --save
npm install markdown-it-fence --save
```## Usage
```js
const markdownitfence = require('markdown-it-fence')function yourPlugin (md, options) {
return markdownitfence(md, 'yourPluginName', {
marker: yourMarker, // default is '`'
render: yourRender,
validate: yourValidate
})
}const md = require('markdown-it')();
md.use(yourPlugin).render(`content you want to parse`)```
### Option params
##### marker
Type: `string`
Default: `Marker of fence block.
##### render
Type: `function`
Default: [defaultRender](./src/index.js)Render function.
##### validate
Type: `function`
Default: [defaultValidate](./src/index.js)Validate function.
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D## Author
**markdown-it-fence** © [geekplux](https://github.com/geekplux), Released under the [MIT](./LICENSE) License.
Authored and maintained by geekplux with help from contributors ([list](https://github.com/geekplux/markdown-it-fence/contributors)).> [github.com/geekplux](https://github.com/geekplux) · GitHub [@geekplux](https://github.com/geekplux) · Twitter [@geekplux](https://twitter.com/geekplux)