disco-lang / disco

Functional teaching language for use in a discrete mathematics course
Other
164 stars 23 forks source link

Syntax highlighting for disco with pygments #81

Open byorgey opened 6 years ago

byorgey commented 6 years ago

It would be nice to write a pygments syntax highlighter for disco, so we can have nice syntax highlighting for code examples in the documentation.

byorgey commented 6 years ago

Reference:

byorgey commented 2 years ago

As an alternative, we could update the pretty-printer so it is able to output tokens tagged with semantic information to aid in coloring. It seems a bit silly to have to maintain a completely separate lexer for the language in Python. I am not sure how this kind of thing usually works.

Of course, a big advantage of using pygments is that it would work natively with readthedocs (I think? see https://github.com/sphinx-doc/sphinx/issues/9105 ) and also with the minted LaTeX package.