uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.
BSD 3-Clause "New" or "Revised" License
128 stars 10 forks source link

Add latex code listings #27

Closed jheer closed 2 years ago

jheer commented 2 years ago

Note: the minted package requires a local Python installation, the pygments Python package must be installed.

jheer commented 2 years ago

@joshuahhh: if you are able to test this out, let me know how it goes.

joshuahhh commented 2 years ago

Thanks Jeff! I gave it a try, and things seem to be working EXCEPT that all my code is in TypeScript + JSX ("tsx"), and Pygments doesn't support that (see https://github.com/pygments/pygments/issues/1815).

In fact, it doesn't support JSX at all (see https://github.com/pygments/pygments/issues/709), though there's a third-party option for that: https://github.com/fcurella/jsx-lexer.

A cursory Google doesn't turn up any third-party lexers for tsx itself. (https://github.com/hatarist/pygments-tsx isn't legit.) It might not be hard to whip one up by combining the built-in TypeScript lexer and the third-part JSX lexer, but that feels like a low priority to me right now.

jheer commented 2 years ago

Thanks @joshuahhh. I will go ahead and merge. We can always change the internal implementation and/or revisit JSX support later.