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: 4 months 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 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-04T10:38:07.000Z (over 2 years ago)
- Last Synced: 2025-03-01T05:12:36.186Z (4 months 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
[](https://npmjs.com/package/markdown-it-fence) [](https://npmjs.com/package/markdown-it-fence) [](https://circleci.com/gh/geekplux/markdown-it-fence) [](https://codecov.io/gh/geekplux/markdown-it-fence)
[](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)