https://github.com/serapath/belmark
creates dom nodes from markdown
https://github.com/serapath/belmark
Last synced: about 1 year ago
JSON representation
creates dom nodes from markdown
- Host: GitHub
- URL: https://github.com/serapath/belmark
- Owner: serapath
- License: mit
- Created: 2016-12-26T18:23:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-02T13:49:16.000Z (over 9 years ago)
- Last Synced: 2024-04-25T06:22:14.211Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://serapath.github.io/belmark
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# belmark
creates dom nodes from markdown
# usage
`npm install belmark`
```js
var belmark = require('belmark')
var markdown = `
# Hello
* world
`
var opts = { gfm: false }
/****************************
as function call
****************************/
var el = belmark.call(opts, markdown)
// or with default `opts`
var el = belmark(markdown)
document.body.appendChild(el)
/****************************
as tagged template
****************************/
var el2 = belmark.bind(opts)`
# Hello
* world
`
// or with default `opts`
var el2 = belmark`
# Hello
* world
`
document.body.appendChild(el2)
```
for more details see: [demo](https://serapath.github.io/belmark)
# api
`var element = belmark.call(opts, source)`
* `source` - Markdown source String
* `opts` - options object for `marked` provided as `this` param
* check [marked](https://www.npmjs.com/package/marked) for available options
# related
inspiration came from
* https://www.npmjs.com/package/beldown
* https://www.npmjs.com/package/element-markdown