Cubxity / typstudio

A W.I.P desktop application for a new typesetting language, typst.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Syntax Highlighting

nandac opened this issue · comments

Dear Folks,

I would like to know how you have built syntax highlighting for Typst.

I am trying to build Syntax highlighting for Kate, which requires the building of an XML file of all the keywords available in the language which is difficult to do by hand.

I would like to know how you handle syntax highlighting and updating it as Typst changes.

I hope you can guide me in this regard.

Many thanks.

I'm a KDE contributor. There's no way to do this for Kate but to create an XML file defining the syntax:

https://invent.kde.org/frameworks/syntax-highlighting/-/tree/master/data/syntax

Interestingly enough some time ago I looked into the same thing and also found it to be difficult enough not to bother. I was interested in building a Qt app similar to Kile for Typst editing, with Kate and Okular parts.

This project seems to handle it here:

https://github.com/Cubxity/typstudio/blob/master/src/lib/editor/lang/typst-tm.json

@olib14 Thanks for the info. I guess I can build it by hand incrementally but it is going to take a while. If I do find an automatic way I will recommend the Kate developers to add a HOWTO.

Sure thing. Feel free to tag me on KDE's GitLab @olib if you ever make an MR - I'd be happy to test syntax highlighting.

Make sure to close this issue!