gfm.macro

1.0.1 • Public • Published

gfm.macro

GitHub Flavored Markdown Babel macro converts Markdown to JSX at compile time using the cmark-gfm C library.

npm


Installation

yarn add gfm.macro babel-plugin-macros

Add macros to your Babel configuration:

{
  "plugins": ["macros"]
}

Usage

import gfm from 'gfm.macro'
 
const jsx = gfm`
GitHub Flavored Markdown
===
`
 
const withOptions = gfm(`
<button>GitHub Flavored Button</button>
`, { unsafe: true })

Options

The default options are as follows:

const defaultOptions = {
    react: true,
    extensions: {
        table: true,
        tasklist: true,
    },
}

Package Sidebar

Install

npm i gfm.macro

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.56 kB

Total Files

3

Last publish

Collaborators

  • mvasilkov