padarom / vuepress-plugin-code-switcher

:arrows_clockwise: Component that adds synchronized multi-language code blocks to your Vuepress sites
https://code-switcher.padarom.xyz
MIT License
41 stars 6 forks source link

Avoid repetitive languages? #5

Closed m-mohr closed 3 years ago

m-mohr commented 3 years ago

So, we'll have a lot of code switches soon and we always have the same 3 languages, so to each CodeSwitcher we need to pass:

:languages="{py:'Python', r:'R', js:'JavaScript'}"

That is very repetitive. Is there a way to avoid that and set them globally? For example, through setting them in the plugin config? So instead of 'code-switcher' use ['code-switcher', {py:'Python', r:'R', js:'JavaScript'}]?

padarom commented 3 years ago

That's a good idea. I don't know if I have much time at the moment, but I'll give something like this a try soon