npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

virtual-markdown

2.0.0

@yoshuawuyts

npmHomeRepoSnykSocket
Downloads:0
$ npm install virtual-markdown
DailyWeeklyMonthlyYearly

virtual-markdown stability

npm version build status test coverage downloads js-standard-style

Convert markdown into virtual-dom. Uses remark and remark-html under the hood.

Installation

$ npm install virtual-markdown

Usage

const highlight = require('mdast-highlight')
const md = require('virtual-markdown')

module.exports = render

function render (h) {
  const text = `
    # funky town, get down, get down
    - or how I learned to love the bomb
  `

  return h('section.main', [
    md(text, {
      use: [ highlight ],
      footnotes: true
    })
  ])
}

API

tree = md(markdown, opts?)

Takes a string of markdown and returns a virtual-dom widget. Takes the following options:

  • use: array of remark plugins to use
  • all other options are passed directy to remark.process()

See Also

  • remark-vdom
  • virtual-widget
  • virtual-dom
  • remark

License

MIT