UNPKG

1.68 kBMarkdownView Raw
1# `@mdx-js/mdx`
2
3[![Build Status][build-badge]][build]
4[![lerna][lerna-badge]][lerna]
5[![Join the community on Spectrum][spectrum-badge]][spectrum]
6
7[MDX][] implementation using [remark][].
8
9## Installation
10
11[npm][]:
12
13```sh
14npm i -S @mdx-js/mdx
15```
16
17## Usage
18
19```js
20const mdx = require('@mdx-js/mdx')
21
22const result = await mdx(`
23# Hello, MDX
24
25I <3 Markdown and JSX
26`)
27
28console.log(result)
29```
30
31Yields:
32
33```js
34export default ({components, ...props}) => (
35 <MDXTag name="wrapper" components={components}>
36 <MDXTag name="h1" components={components}>{`Hello, MDX`}</MDXTag>
37 <MDXTag name="p" components={components}>{`I <3 Markdown and JSX`}</MDXTag>
38 </MDXTag>
39)
40```
41
42## Contribute
43
44See the [Support][] and [Contributing][] guidelines on the MDX website for ways
45to (get) help.
46
47This project has a [Code of Conduct][coc].
48By interacting with this repository, organisation, or community you agree to
49abide by its terms.
50
51## License
52
53[MIT][] © [Compositor][] and [Vercel][]
54
55<!-- Definitions -->
56
57[build]: https://travis-ci.com/mdx-js/mdx
58[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
59[lerna]: https://lernajs.io/
60[lerna-badge]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
61[spectrum]: https://spectrum.chat/mdx
62[spectrum-badge]: https://withspectrum.github.io/badge/badge.svg
63[contributing]: https://mdxjs.com/contributing
64[support]: https://mdxjs.com/support
65[coc]: https://github.com/mdx-js/.github/blob/master/code-of-conduct.md
66[mit]: license
67[remark]: https://github.com/remarkjs/remark
68[compositor]: https://compositor.io
69[vercel]: https://vercel.com
70[mdx]: https://github.com/mdx-js/mdx
71[npm]: https://docs.npmjs.com/cli/install