{"repo":"remcohaszing/rehype-mdx-code-props","free":true,"listed":false,"github":"https://github.com/remcohaszing/rehype-mdx-code-props","clone":"git clone https://github.com/remcohaszing/rehype-mdx-code-props.git","description":"A rehype MDX plugin for interpreting markdown code meta as props","language":"TypeScript","stars":50,"topics":["hast","html","markdown","mdx","rehype","rehype-plugin","unified"],"license":"MIT","category":"productivity","readme_excerpt":"rehype-mdx-code-props A rehype MDX plugin for interpreting markdown code meta as props. Table of Contents - Installation - Usage - API - rehypeMdxCodeProps - Compatibility - License Installation Usage This plugin interprets markdown code block metadata as JSX props. For example, given a file named example.mdx with the following content: js copy filename=\"awesome.js\" onOpen={props.openDemo} {...props} console.log('Everything is awesome!') The following script: Roughly yields: The element doesn’t support those custom props. Use custom components to give the props meaning. Note This plugin transforms the hast (HTML) nodes into JSX. After running this plugin, they can no longer be processed by other plugins. To combine it with other plugins, such as syntax highlighting plugins, rehype-mdx-code-props must run last. API This package has a default export rehypeMdxCodeProps . rehypeMdxCodeProps An MDX rehype plugin for transforming markdown code meta into JSX props. Options - elementAttributeNameCase ( 'html' 'react' ): The casing to use for attribute names. This should match the elementAttributeNameCase value passed to MDX. (Default: 'react' ) - tagName ( 'code' 'pre' ): The tag name to add the attributes to. (Default: 'pre' ) Compatibility This plugin works with Node.js 16 or greater and MDX 3. License MIT © Remco Haszing","default_branch":null,"files":null,"tree":[],"storefront":"/r/remcohaszing","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/remcohaszing/rehype-mdx-code-props/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}