Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@shiki/rehype: templating for dynamic parts of code? #858

Open
3 of 4 tasks
karlhorky opened this issue Dec 4, 2024 · 0 comments
Open
3 of 4 tasks

@shiki/rehype: templating for dynamic parts of code? #858

karlhorky opened this issue Dec 4, 2024 · 0 comments

Comments

@karlhorky
Copy link
Contributor

Clear and concise description of the problem

Similar to https://github.com/orgs/mdx-js/discussions/2288 , I'm looking for a way to dynamically interpolate dynamic values in code blocks

Suggested solution

Eg one example could look like this:

```bash
pnpm add @upleveled/ley@{props.versions.ley} tsx@{props.versions.tsx}
```

Where the final version would look like this:

pnpm add @upleveled/ley@0.9.2 tsx@4.19.1

These would be interpolated ideally based on props passed to the MDX compiled component.

Alternative

Use a React component to apply Shiki highlighting in a different way, instead of @rehype/shiki

Additional context

--

Validations

Contributes

  • If this feature request is accepted, I am willing to submit a PR to fix this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant