-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add support for cs files! Yes I do use vitepress to document C# libraries 😁 #861
Comments
Have you tried The currently supported languages are documented in https://github.com/shikijs/shiki/blob/main/docs/languages.md#all-languages |
I can't replace the file extensions I'm using in the library. I guess you misunderstood... I'm using <<< like in https://vitepress.vuejs.org/guide/markdown.html#import-code-snippets |
Sorry, I misunderstood. You're right, VitePress doesn't support the |
Thanks for pointing this out. We are probably just adding the extension as the language in our snippet plugin. We should instead be mapping the extension to language the way linguist does. Alternatively, we can also implement something similar to this: https://github.com/fabioaanthony/markdown-it-vuepress-code-snippet-enhanced Also, even in fenced code blocks, we don't currently show language on top right for C# I guess. We have a hard coded list in our CSS to do that. But I guess this can be fixed in the code block plugin itself (the way we added copy, we can add another span telling the language and just style it from CSS, it will eliminate the need for hard coding). |
<<< @/snippets/csharp-snippets.cs{csharp} It's work ok |
Is your feature request related to a problem? Please describe.
Although C# is one of the available languages it does not recognize cs extension while trying to use <<< to import code.
[vite] Internal server error: No language registration for cs
Describe the solution you'd like
I'm not sure how it work internally but it seems in only missing the recognition of cs files as C# language!
Describe alternatives you've considered
If it can be done by default great.
If this needs an configuration maybe updating the docs would suffice.
Additional context
I have support for other languages would improve the usage (and popularity) of vitepress 🤓
Validations
The text was updated successfully, but these errors were encountered: