{"id":16612903,"url":"https://github.com/ttys3/syntect-assets","last_synced_at":"2025-12-12T15:43:40.488Z","repository":{"id":188627293,"uuid":"679110320","full_name":"ttys3/syntect-assets","owner":"ttys3","description":"syntect syntax and theme assets from [bat](https://github.com/sharkdp/bat)","archived":false,"fork":false,"pushed_at":"2023-08-22T07:53:30.000Z","size":31756,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T12:09:52.735Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttys3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-16T05:52:39.000Z","updated_at":"2025-05-05T06:15:34.000Z","dependencies_parsed_at":"2024-10-12T01:45:19.083Z","dependency_job_id":"c2be28cd-aeb1-4825-be0d-6a2ddad4e069","html_url":"https://github.com/ttys3/syntect-assets","commit_stats":null,"previous_names":["ttys3/syntect-assets"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ttys3/syntect-assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsyntect-assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsyntect-assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsyntect-assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsyntect-assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttys3","download_url":"https://codeload.github.com/ttys3/syntect-assets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttys3%2Fsyntect-assets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27676605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T01:45:17.242Z","updated_at":"2025-12-12T15:43:40.466Z","avatar_url":"https://github.com/ttys3.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syntect-assets\n\n[syntect](https://github.com/trishume/syntect) syntax and theme assets from [bat](https://github.com/sharkdp/bat)\n\n## why?\n\n`bat`'s syntect syntax is updated and improved compared to syntect builtin ones\n\n## usage\n\nref https://docs.rs/syntect/\n\n```rust\n/// A simple program that prints its own source code using the syntect-assets library\nuse syntect::parsing::SyntaxSet;\nuse syntect::highlighting::{ThemeSet, Style};\nuse syntect::util::as_24_bit_terminal_escaped;\nuse syntect::easy::HighlightFile;\nuse std::io::BufRead;\nuse syntect_assets::assets::HighlightingAssets;\n\nfn main() {\n    let assets = HighlightingAssets::from_binary();\n\n    let ss = assets.get_syntax_set().unwrap();\n    let theme = assets.get_theme(\"OneHalfDark\");\n\n    let mut highlighter = HighlightFile::new(file!(), ss, theme).unwrap();\n    let mut line = String::new();\n    while highlighter.reader.read_line(\u0026mut line).unwrap() \u003e 0 {\n        {\n            let regions: Vec\u003c(Style, \u0026str)\u003e = highlighter.highlight_lines.highlight_line(\u0026line, \u0026ss).unwrap();\n            print!(\"{}\", as_24_bit_terminal_escaped(\u0026regions[..], true));\n        } // until NLL this scope is needed so we can clear the buffer after\n        line.clear(); // read_line appends so we need to clear between lines\n    }\n}\n```\n\n## supported themes\n\n```yaml\nThemes:\n- 1337\n- Coldark-Cold\n- Coldark-Dark\n- DarkNeon\n- Dracula\n- GitHub\n- Monokai Extended\n- Monokai Extended Bright\n- Monokai Extended Light\n- Monokai Extended Origin\n- Nord\n- OneHalfDark\n- OneHalfLight\n- Solarized (dark)\n- Solarized (light)\n- Sublime Snazzy\n- TwoDark\n- Visual Studio Dark+\n- ansi\n- base16\n- base16-256\n- gruvbox-dark\n- gruvbox-light\n- zenburn\n```\n\n## supported syntaxes\n\nsee [examples/list_syntaxes_and_themes.rs](examples/list_syntaxes_and_themes.rs) example\n\nyou can run the example to get the list of supported syntaxes and themes\n\n```bash\ncargo run --example list_syntaxes_and_themes\n```\n\n## troubleshooting\n\nthe latest syntax fixed many bugs, but we can not update to that.\n\nfor example, fenced golang now support both `go` and `golang`, prev just support `golang`, but most people use `go` for that.\n\nthe latest version fixed the issue:\nhttps://github.com/sublimehq/Packages/blob/master/Markdown/Markdown.sublime-syntax\n\n\nsome issues:\n\n* syntect does not support sublime-syntax from Sublime Text Build 4075\nsee https://github.com/trishume/syntect/issues/323\n\n* sublimehq packages: Missing mandatory key in YAML file: match\nhttps://github.com/trishume/syntect/issues/461\n\n* zola: Investigate tree-sitter to replace syntect\n  \u003e Our syntect syntaxes are stuck on old versions of the grammars because of new features in the Sublime grammar format not supported by Syntect.\n\n  https://github.com/getzola/zola/issues/1787\n\n## related\n\nhttps://github.com/microsoft/vscode/blob/7a464d6069a39b7d0e63c3da453d43a53eea7495/extensions/markdown-basics/syntaxes/markdown.tmLanguage.json#L1391\n\nhttps://github.com/microsoft/vscode-textmate\n\nhttps://github.com/microsoft/vscode-markdown-tm-grammar\n\nSublime Text\n\nSyntax Definitions https://www.sublimetext.com/docs/syntax.html\n\nScope Naming https://www.sublimetext.com/docs/scope_naming.html\n\nThemes https://www.sublimetext.com/docs/themes.html\n\nColor Schemes https://www.sublimetext.com/docs/color_schemes.html\n\nTextMate language grammar definition https://macromates.com/manual/en/language_grammars\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fsyntect-assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttys3%2Fsyntect-assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttys3%2Fsyntect-assets/lists"}