npm.io
1.2.1 • Published 5 years ago

zzz-markdown

Licence
ISC
Version
1.2.1
Deps
3
Size
7 kB
Vulns
3
Weekly
0

zzz-markdown

ZZZ rendered markdown

Usage

const z = require('zzz')
const markdown = require('zzz-markdown')
const darkOneTheme = require('zzz-markdown/dark-one')

const app = z(() => {
  return markdown`.${darkOneTheme}`(`
# Hello world!

Markdown rendered with ZZZ. Includes code highlighting also:

\`\`\`js
const hello = 'world!'
\`\`\`
`)

})

z.mount(app)

API

const component = markdown``(attrs, text)

Render text as Markdown using a stateful component. This will cache the result, but can be cached busted by keying the component. The result is wrapped in a div, to make applying styles across the whole block easy. The element can be changed by composition. attrs are applied to the div.

const className = require('zzz-markdown/dark-one')

Dark One theme as a scoped highlight.js theme. See the example above for usage

Install

npm install zzz-markdown

License

ISC

Keywords