@fujocoded/rehype-code-params
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@fujocoded/rehype-code-params

Rehype plugin to style param vaues in inline code blocks. It does so by wrapping any value between [] brackets within inline code blocks in a <span>.

Sample usage

In astro.config.js:

import { rehypeCodeParams } from "@fujocoded/rehype-code-params";

export default defineConfig({
  // ...
  integrations: [
    mdx({
      rehypePlugins: [rehypeCodeParams],
    }),
  ],
});

In an .md(x) file:

This code has a param: `git commit -m "[commit_message]"`

This will output the following HTML for the code block:

<code>git commit -m "<span class="rehype-param">[commit_message]</span>"</code>

Readme

Keywords

Package Sidebar

Install

npm i @fujocoded/rehype-code-params

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

15.8 kB

Total Files

7

Last publish

Collaborators

  • enigmalea
  • essential.randomn3ss