1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-10-08 22:52:04 +02:00
Files
chroma/_tools
Florian Freitag a5dc08622e Add argparse to pygemnts2chroma_xml.py script (#1140)
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
  ```
2025-09-12 13:34:57 +10:00
..
2022-01-27 15:22:00 +11:00
2022-01-27 15:22:00 +11:00
2020-02-26 21:03:38 +11:00
2025-06-21 10:22:17 +10:00
2025-06-21 10:22:17 +10:00