-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to use other languages beside JS / TS? #119
Comments
Yeah, you're handling it wrong - all code samples are ran through shiki, only TypeScript-y can have the twoslash processing though. So you can't do |
Oh right - totally didn't realise that. I thought that shiki was only invoked when you added the The docs say:
I wonder if it might be worth being explicit that Twoslash can be used with JavaScript, TypeScript and JSX/TSX? (i.e. not all code blocks) I have an unrelated question alongside that. The docs say:
Is there an example somewhere of what that would look like? Things I'm thinking:
I've got a PR open to add Bicep support to Shiki, but if I wanted to just use Shiki with Bicep right now, I can't quite work out the way. |
Yeah, that needs to be documented at shiki level, ideally as a new section in here: https://github.com/shikijs/shiki/blob/main/docs/languages.md#adding-grammar |
Hey all!
I'm confused. According to the docs, Twoslash:
However, if I try and use something like C# I see this error:
In this case Shiki supports
csharp
:['csharp', 'https://github.com/dotnet/csharp-tmLanguage/blob/main/grammars/csharp.tmLanguage'],
https://github.com/shikijs/shiki/blob/a29e1991b2e24c8ebbf53112a14f80c52a338587/scripts/grammarSources.ts#L158
So I'm a little puzzled as to why this doesn't work? Am I doing something wrong?
You can try this out by using the steps in johnnyreilly/blog.johnnyreilly.com#95 and going to http://localhost:3000/2021/07/01/c-sharp-9-azure-functions-in-process
The text was updated successfully, but these errors were encountered: