TalonCommunity / Wiki

Community maintained wiki for Talon Voice
https://talon.wiki
80 stars 80 forks source link

Talon syntax highlighting #255

Open C-Loftus opened 6 months ago

C-Loftus commented 6 months ago

If someone is good at regex it would greatly help us and make the wiki nicer if we could port vscode format from https://github.com/mrob95/vscode-TalonScript/blob/master/syntaxes/talon.tmLanguage.json into the prism syntax.

All the highlighting just goes within the prism-talon.js file and uses the syntax as defined by https://prismjs.com/extending.html

Since Prism uses a different syntax unfortunately most content from the vscode addon has to be edited a little bit. However, the vscode addon is a very good start.

If anyone is good at regex and wants to help, that would be super helpful. Ping me if you have any questions and want to help.

Nova38 commented 3 months ago

There might also be the potential to use the vscode theme directly via shikjs https://github.com/shikijs which uses the same render as vscode. It might need a little work to get it to work, but it does have a official rehype plugin I think.

It's uses is also discussed here: https://github.com/facebook/docusaurus/issues/9122

C-Loftus commented 3 months ago

Looks cool, not sure how much bandwidth that will take. We have most of the logic for syntax highlighting so I am thinking it might just be easier to port the existing regexes to the prism syntax. But definitely good to know and if someone does want to tackle this at some point, certainly fine with whatever is easier.

Nova38 commented 3 months ago

Fair enough, I will take a shot at it here in a week or two. I'm settling into a new job. I am also am gonna be finishing up an addition to the talondoc repo to use the treesitter bindings she made to get syntax highlighting working with pygments and sphinx.bIts mostly done from a year or so. After that I can probably give this a shot.