1 stable release

4.6.1 Jan 23, 2022

#16 in #highlighter

Download history 175/week @ 2024-07-20 168/week @ 2024-07-27 329/week @ 2024-08-03 201/week @ 2024-08-10 302/week @ 2024-08-17 260/week @ 2024-08-24 233/week @ 2024-08-31 391/week @ 2024-09-07 232/week @ 2024-09-14 246/week @ 2024-09-21 188/week @ 2024-09-28 199/week @ 2024-10-05 241/week @ 2024-10-12 320/week @ 2024-10-19 250/week @ 2024-10-26 230/week @ 2024-11-02

1,064 downloads per month
Used in broot

MIT license

1MB
7K SLoC

This is a fork of Syntect.

This fork is very similar to the original version 4.6 of Syntect, the last non yanked version of Syntect at time of writing, but modified to return errors instead of panicking in some cases of failing syntaxic colorings.

Please try to use the original Syntect instead of this temporary fork. There's no project to maintain it for a long time nor for adding features: as soon as Syntect 5 is released without cases of panics and the applications using this fork are ported, it will be terminated.

If you really feel like you need to use this, contact @dystroy on the Miaou chat.


lib.rs:

Welcome to the syntect docs.

Much more info about syntect is available on the Github Page.

May I suggest that you start by reading the Readme.md file in the main repo. Once you're done with that you can look at the docs for parsing::SyntaxSet and for the easy module.

Almost everything in syntect is divided up into either the parsing module for turning text into text annotated with scopes, and the highlighting module for turning annotated text into styled/colored text.

Some docs have example code but a good place to look is the syncat example as well as the source code for the easy module in easy.rs as that shows how to plug the various parts together for common use cases.

Dependencies

~0.9–10MB
~119K SLoC