@mdx-js/preact
Preact implementation for MDX
Last updated 16 days ago by johno .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mdx-js/preact 
SYNC missed versions from official npm registry.

@mdx-js/preact

Build Status lerna Join the community on Spectrum

Map components to HTML elements based on the Markdown syntax. Serves as the Preact implementation for MDX.

Installation

npm:

npm install --save @mdx-js/preact

Usage

<!-- helloworld.md -->

# Hello, World!
/* @jsx h */
import {h} from 'preact'
import {MDXProvider} from '@mdx-js/preact'
import {render} from 'preact-render-to-string'

import HelloWorld from './helloworld.md'

const H1 = props => <h1 style={{color: 'tomato'}} {...props} />

console.log(
  render(
    <MDXProvider components={{h1: H1}}>
      <HelloWorld />
    </MDXProvider>
  )
)

Yields:

<h1 style="color:tomato">Hello, world!</h1>

Contribute

See the Support and Contributing guidelines on the MDX website for ways to (get) help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and Vercel

Current Tags

  • 1.6.3-ci.0                                ...           ci (a month ago)
  • 1.6.6                                ...           latest (16 days ago)
  • 2.0.0-next.1                                ...           next (a month ago)

17 Versions

  • 1.6.6                                ...           16 days ago
  • 1.6.5                                ...           a month ago
  • 2.0.0-next.1                                ...           a month ago
  • 1.6.4                                ...           a month ago
  • 2.0.0-next.0                                ...           a month ago
  • 1.6.3-ci.0                                ...           a month ago
  • 1.6.3                                ...           a month ago
  • 1.6.2                                ...           a month ago
  • 1.6.1                                ...           2 months ago
  • 1.6.0                                ...           2 months ago
  • 1.5.9                                ...           2 months ago
  • 1.5.9-ci.5                                ...           2 months ago
  • 1.5.8                                ...           3 months ago
  • 1.5.8-ci.9                                ...           4 months ago
  • 1.5.8-alpha.0                                ...           4 months ago
  • 1.5.7                                ...           4 months ago
  • 1.5.6                                ...           4 months ago
Downloads
Today 0
This Week 2
This Month 2
Last Day 0
Last Week 4
Last Month 28
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

Copyright 2014 - 2017 © taobao.org |