Closed johnnyreilly closed 3 years ago
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 cs twoslash
but cs
will work fine.
Oh right - totally didn't realise that. I thought that shiki was only invoked when you added the twoslash
suffix.
The docs say:
All code sample use Shiki, then you can opt-in to have Twoslash markup inside specific code blocks.
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:
Supports all possible languages available on the VS Code extension marketplace. That’s over 200 languages. All you need is a
.tmlanguage
file for anything not shipped with Shiki.
Is there an example somewhere of what that would look like? Things I'm thinking:
.tmlanguage
file look like?.tmlanguage
file in the root of your project, or do you have to do some configuration?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
: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 https://github.com/johnnyreilly/blog.johnnyreilly.com/pull/95 and going to http://localhost:3000/2021/07/01/c-sharp-9-azure-functions-in-process