mirror of
https://github.com/alecthomas/chroma.git
synced 2025-10-08 22:52:04 +02:00
I also adapted the README to use `uv` since this removes an install step (uv resolves and installs dependencies on `uv run`). We could also debate if we should switch from `KotlinLexer` as an example to some other lexer as there seems to be a bug upstream in pygments where `KotlinLexer.get_tokendefs()` returns a string that is not valid unicode. You can read more about the bug in [this issue](https://github.com/pygments/pygments/issues/2964). With argparse the error messages are a lot nicer and the script can better explain itself. ```bash uv run pygments2chroma_xml.py --help usage: pygments2chroma_xml.py [-h] lexer_class Converts pygments RegexLexer classes to chroma xml grammar definitions. positional arguments: lexer_class The class name of the pygments lexer, like: 'pygments.lexers.jvm.KotlinLexer'. options: -h, --help show this help message and exit ```