Dear groffers,

as one of the things coming out of my master thesis (written completely
in ms with Groff), here is a small preprocessor for syntax highlighting
code blocks based on Pygments:

https://github.com/rhaberkorn/groff-tools#highlight-python

btw. I also still have Scintilla/Lexilla syntax highlighting support for
Troff lying around for years, that could improve dozens of text editors.
But I don't know when I will find the time and motivation to polish it
up.
Once you dive into Troff as a language, you realize that it's actually
unparseable in therefore impossible to properly syntax highlight. Even
after restricting the language in sane ways that will work in 99.9% of
the cases, it's still hard to highlight *correctly*. Basically you will
have to reimplement a large part of the Groff-parser to do it right, as
you need intimate knowledge of the syntax of certain requests. And then,
there ideally needs to be support for the other Troff variants out
there as well. That's why I never contributed it to the Lexilla project.

Best regards,
Robin

Reply via email to