smithy4s icon indicating copy to clipboard operation
smithy4s copied to clipboard

switch kotlin marker to smithy

Open yisraelU opened this issue 2 years ago • 7 comments

update all references of kotlin to smithy now that MD supports smithy annotation

yisraelU avatar Aug 09 '23 14:08 yisraelU

Won't this get rid of all syntax highlighting? Or does prism/highlight/whatever support smithy now?

lewisjkl avatar Aug 09 '23 15:08 lewisjkl

Or does prism/highlight/whatever support smithy now?

~It does :) it's called "linguist"~

eeeeeergh yeah you're right, we're using prism on the microsite -_____-'

Baccata avatar Aug 09 '23 15:08 Baccata

Yeah, which I think we could provide some custom regexes and Prism can use them. Never tried it myself, but maybe we could reuse from the VSCode highlighting... https://prismjs.com/extending.html

lewisjkl avatar Aug 09 '23 15:08 lewisjkl

Apparently docusaurus can use the shiki highlighter, which uses textmate grammars, which is what we use to define highlighting in vscode.

https://www.npmjs.com/package/docusaurus-preset-shiki-twoslash

So I believe if we found a way to load our textmate grammar in shiki, we could do the full switch without angering docusaurus. Docs for shiki are there : https://github.com/shikijs/shiki#configuration-and-options

Baccata avatar Aug 09 '23 16:08 Baccata

And here are the docs on how to do just that : https://github.com/shikijs/shiki/blob/main/docs/languages.md#supporting-your-own-languages-with-shiki

Now it'd just be a matter of understanding how to wire this altogether

Baccata avatar Aug 09 '23 16:08 Baccata

ok , so IIUC , we can keep the smithy annotation and benefit from linguist support for Smithy, we would just need to provide prism with a custom language grammar.

yisraelU avatar Aug 10 '23 01:08 yisraelU

ok , so IIUC , we can keep the smithy annotation and benefit from linguist support for Smithy, we would just need to provide prism with a custom language grammar.

Exactly, that, or we switch highlighters to shiki which actually supports the same grammar language that we already use for vscode, which means we wouldn't have to re-implement the grammar

Baccata avatar Aug 10 '23 07:08 Baccata