syntect-assets
syntect syntax and theme assets from bat
why?
bat's syntect syntax is updated and improved compared to syntect builtin ones
usage
/// A simple program that prints its own source code using the syntect-assets library
use SyntaxSet;
use ;
use as_24_bit_terminal_escaped;
use HighlightFile;
use BufRead;
use HighlightingAssets;
supported themes
Themes:
- 1337
- Coldark-Cold
- Coldark-Dark
- DarkNeon
- Dracula
- GitHub
- Monokai Extended
- Monokai Extended Bright
- Monokai Extended Light
- Monokai Extended Origin
- Nord
- OneHalfDark
- OneHalfLight
- Solarized (dark)
- Solarized (light)
- Sublime Snazzy
- TwoDark
- Visual Studio Dark+
- ansi
- base16
- base16-256
- gruvbox-dark
- gruvbox-light
- zenburn
supported syntaxes
see examples/list_syntaxes_and_themes.rs example
you can run the example to get the list of supported syntaxes and themes
troubleshooting
the latest syntax fixed many bugs, but we can not update to that.
for example, fenced golang now support both go and golang, prev just support golang, but most people use go for that.
the latest version fixed the issue: https://github.com/sublimehq/Packages/blob/master/Markdown/Markdown.sublime-syntax
some issues:
-
syntect does not support sublime-syntax from Sublime Text Build 4075 see https://github.com/trishume/syntect/issues/323
-
sublimehq packages: Missing mandatory key in YAML file: match https://github.com/trishume/syntect/issues/461
-
zola: Investigate tree-sitter to replace syntect
Our syntect syntaxes are stuck on old versions of the grammars because of new features in the Sublime grammar format not supported by Syntect.
related
https://github.com/microsoft/vscode-textmate
https://github.com/microsoft/vscode-markdown-tm-grammar
Sublime Text
Syntax Definitions https://www.sublimetext.com/docs/syntax.html
Scope Naming https://www.sublimetext.com/docs/scope_naming.html
Themes https://www.sublimetext.com/docs/themes.html
Color Schemes https://www.sublimetext.com/docs/color_schemes.html
TextMate language grammar definition https://macromates.com/manual/en/language_grammars