GitXplorerGitXplorer
r

recma-mdx-is-mdx-component

public
5 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
ca16820a23443a4b6170f59862c0d01ff0982f39

1.1.3

rremcohaszing committed a year ago
Verified
cca2fb522546e754542a6994e48b8361daa9256b

Don’t update npm in CI

rremcohaszing committed a year ago
Verified
700c8b010f9d1b12b175accd31b5c242b6735b2d

1.1.2

rremcohaszing committed a year ago
Verified
10091b41d6683af228ba5e3e5057c87da140a984

Include index in the package

rremcohaszing committed a year ago
Verified
c7b3e7bb1a616e5e7cf9709411eefe7ca08cd85d

Remove named export

rremcohaszing committed a year ago
Verified
17b106c881489fec6461ac822a0aa7040c89170b

1.1.1

rremcohaszing committed a year ago

README

The README file for this repository.

recma-mdx-is-mdx-component

github actions npm version npm downloads codecov

A recma plugin to define the isMDXComponent property on MDX components.

Table of Contents

Installation

npm install recma-mdx-is-mdx-component

Usage

This recma plugin assigns true to the property MDXContent.isMDXComponent.

For example, given a file named example.mdx with the following contents:

Some MDX content

The following script:

import { readFile } from 'node:fs/promises'

import { compile } from '@mdx-js/mdx'
import recmaPluginInjectisMDXComponent from 'recma-mdx-is-mdx-component'

const { contents } = await compile(await readFile('example.mdx'), {
  jsx: true,
  recmaPlugins: [recmaPluginInjectisMDXComponent]
})
console.log(contents)

Roughly yields:

MDXContent.isMDXComponent = true
export default function MDXContent() {
  return <p>Some MDX content</p>
}

API

The default export is a recma plugin. It takes no options.

Compatibility

This project is compatible with Node.js 16 or greater.

License

MIT © Remco Haszing