1.0.0 • Published 5 years ago
inline-mdx.macro v1.0.0
inline-mdx.macro
A babel-macro for converting mdx into an inline component.
/** @jsx mdx */
import { mdx } from '@mdx-js/react'
import { inline } from 'inline-mdx.macro'
const SomeMDXComponent = inline`
## This is some MDX source
<SomeComponent />
~~strikethrough~~
`
generates...
/** @jsx mdx */
import { mdx } from '@mdx-js/react'
const SomeMDXComponent = ...;
// you can now do <SomeMDXComponent />
⚠️ Important! ⚠️
You must add the following to any file using the inline
macro:
/** @jsx mdx */
import { mdx } from '@mdx-js/react'
This ensures mdx picks up on the jsx code and renders it correctly.
Changes from v0 to v1:
- Updated to MDX v1
- Removed the
import
macro - Template strings are now formatted first using the dedent library
1.0.0
5 years ago
1.0.0-alpha.4
5 years ago
1.0.0-alpha.3
5 years ago
1.0.0-alpha.2
5 years ago
0.2.5
6 years ago
0.2.4
6 years ago
0.2.3
6 years ago
0.2.2
6 years ago
0.2.1
6 years ago
0.1.1
6 years ago
0.1.0
6 years ago