Skip to content

VerinFast/pygments_tsx

Repository files navigation

codecov

What is this?

This package includes lexers for JSX and TSX files for Pygment. Pull requests are requested, and the code is released under the MIT License. We make no warranties this thing works, just doing our best.

To use

Either: pip install pygments-tsx

or add us to your requirements wherever they may be these days. (Looking at you, SetupTools, Poetry, PyPi... get it together.)

Acknowledgments

This includes Flavio Curella's awesome package JSX Lexer, and includes the ideas and some code from Igor Hatarist's stab at this same problem pygments-tsx. Flaws were introduced by StartupOS, good stuff came from them.

There's also a hack in here for forcing pygments to accept classes programatically. That was based on discussions in this thread, and specifically suggestions from Vincent Bernat and Jean Abou-Samra