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

Support custom attributes such as twoslash for snippets #3823

Open
4 tasks done
ChronicStone opened this issue Apr 24, 2024 · 0 comments
Open
4 tasks done

Support custom attributes such as twoslash for snippets #3823

ChronicStone opened this issue Apr 24, 2024 · 0 comments
Labels

Comments

@ChronicStone
Copy link

Is your feature request related to a problem? Please describe.

Currently when you render a code block through a snippet on Vitepress, you don't have a way to append custom attributes, such as twoslash

Describe the solution you'd like

Be able to append custom attributes such as twoslash so that twoslash can be used with snippets as well

Describe alternatives you've considered

I've considered doing a plugin that re-implements the built-in snippet plugin but with that capability, but it feels like this should belong to the built-in plugin.

Maybe it is already the case & I just didn't understand how to do it. I've seen from the docs that this works :

<<< ./.examples/financial-report/data.ts{ts:line-numbers}

But somehow this does not work :

<<< ./.examples/financial-report/data.ts{ts:twoslash}

Additional context

Shiki twoslash :
https://shiki.style/packages/twoslash

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant