This commit is contained in:
Roberto Alsina 2024-08-04 21:44:23 -03:00
parent dc5b982a0b
commit da963e8a31

View File

@ -1,6 +1,6 @@
# tartrazine # TARTRAZINE
Tartrazine is a library to syntax-highlight code. It is Tartrazine is a library to syntax-highlight code. It is
a port of [Pygments](https://pygments.org/) to a port of [Pygments](https://pygments.org/) to
[Crystal](https://crystal-lang.org/). Kind of. [Crystal](https://crystal-lang.org/). Kind of.
@ -12,7 +12,7 @@ formatters, yet, only the part that parses the code (the lexers).
# A port of what? Why "kind of"? # A port of what? Why "kind of"?
Because I did not read the Pygments code. And this is actually Because I did not read the Pygments code. And this is actually
based on [Chroma](https://github.com/alecthomas/chroma) ... based on [Chroma](https://github.com/alecthomas/chroma) ...
although I did not read that code either. although I did not read that code either.
Chroma has taken most of the Pygments lexers and turned them into Chroma has taken most of the Pygments lexers and turned them into
@ -21,11 +21,11 @@ and a pile of test cases from Pygments, and I slapped them together
until the tests passed and my code produced the same output as until the tests passed and my code produced the same output as
Chroma. Think of it as *extreme TDD*. Chroma. Think of it as *extreme TDD*.
Currently the pass rate for tests in the supported languages Currently the pass rate for tests in the supported languages
is `96.8%`, which is *not bad for a couple days hacking*. is `96.8%`, which is *not bad for a couple days hacking*.
This only covers the RegexLexers, which are the most common ones, This only covers the RegexLexers, which are the most common ones,
but it means the supported languages are a subset of Chroma's, which but it means the supported languages are a subset of Chroma's, which
is a subset of Pygments'. is a subset of Pygments'.
Currently Tartrazine supports ... 241 languages. Currently Tartrazine supports ... 241 languages.