Closed jcleneveu-stancer closed 11 months ago
@brc-dd Thanks a lot for the quick answer :pray: ! I was not aware that this plugin existed. I will take a look and try. From what I'm reading, it should definitely solve my issue.
Still, on the long-run though, it would be quite nice to have this feature embedded into core vitepress code blocks, to avoid:
tabs
instead of code-block
when a sync is wantedNot a big deal, but it can still be interesting to consider.
Thanks a lot :+1:
Do you want me to close the issue, or let it open?
Close this if it works for you. There might be slight styles difference, but from what I see, you could use tabs everywhere. No need to use code-block.
Also, regarding it's installation instructions, you might need to do something like this for theme:
export default {
extends: Theme, // instead of ...Theme
enhanceApp({ app }) {
enhanceAppWithTabs(app)
}
}
Nice, thanks a lot !
Is your feature request related to a problem? Please describe.
I am trying to implement a global code group switch on the web page.
For instance, if somebody selects "Python" or "PHP", it changes all the code groups on the whole pages to "Python" or "PHP". This would be the equivalent to https://github.com/padarom/vuepress-plugin-code-switcher for vitepress.
Describe the solution you'd like
The API could look like:
::: code-group
standalone would not be synchronized::: code-group:synchronized
would be synchronized with all other groups with a default ID::: code-group:synchronized:group-id
would be synchronized with all other groups that matches the same IDDescribe alternatives you've considered
A plugin to do this could also work, but it may definitely be part of the core features of vitepress.
Additional context
Thank you for this amazing project :heart:
Validations