syntect

Generate ANSI or HTML syntax highlighting in Rust using Syntect.

3|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill syntect-yankeeinlondon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: syntect
Source: https://github.com/yankeeinlondon/rusty-biscuit/tree/main/.claude/skills/syntect
Command: npx skills add https://github.com/yankeeinlondon/rusty-biscuit --skill syntect-yankeeinlondon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable fast and accurate syntax highlighting in Rust projects using Syntect with Sublime Text syntax definitions and TextMate themes.

Core Features & Use Cases

  • Two-stage pipeline: parsing to scopes, then highlighting to styles
  • Line-by-line processing for memory efficiency
  • Pre-load defaults with SyntaxSet::load_defaults_newlines() and ThemeSet::load_defaults()
  • Binary dumps for production startup time
  • ANSI terminal output with as_24_bit_terminal_escaped
  • HTML output options: inline styles or CSS classes
  • Streaming for large files via HighlightFile
  • Always reset terminal colors after output
  • Supports TypeScript and modern themes via Sublime/TextMate grammars
  • Used in tools like bat and delta

Quick Start

Highlight a Rust code snippet using Syntect and print ANSI-colored output.

Frequently Asked Questions about syntect

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add syntax highlighting to a Rust CLI tool for terminal output?

Syntax highlighting in a Rust CLI tool is achieved using Syntect to parse code into scopes with SyntaxSet and render ANSI terminal colors via as_24_bit_terminal_escaped, always resetting terminal colors after output.

Can I highlight large files line-by-line in Rust without running out of memory?

Yes, streaming large files in Rust is supported using Syntect's HighlightFile for line-by-line processing, which maintains memory efficiency while applying Sublime Text syntax definitions and TextMate themes.

Does syntect support generating HTML output with inline styles or CSS classes?

Syntect supports HTML output with options for either inline styles or CSS classes, using a two-stage pipeline that parses text into scopes and then highlights them using loaded ThemeSet definitions.

How can I reduce startup time for a Rust syntax highlighting application?

You can reduce startup time for Rust syntax highlighting by using Syntect's binary dumps, which serialize pre-loaded SyntaxSet and ThemeSet data so grammars and themes bypass parsing from scratch on launch.

What's the best way to highlight TypeScript and modern languages in a Rust static site generator?

Highlighting TypeScript and modern languages in a Rust static site generator is best handled by Syntect with Sublime Text syntax definitions, parsing code into scopes to render styled HTML or ANSI output.

Do I need a Rust toolchain to use Sublime syntax definitions for code highlighting?

Yes, a Rust toolchain is required because Syntect is a Rust library that loads Sublime Text syntax definitions via SyntaxSet and TextMate themes via ThemeSet to perform its two-stage parsing and highlighting pipeline.