All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.2.0 - 2026-02-13
- Core API:
content_hash(code, language)— deterministic SHA-256 hash for (code, language) pairs, for block-level cache keys - Core API:
content_hash()now accepts optionalhl_linesandshow_linenosfor cache keys of complex blocks (line highlighting, line numbers) - Parallel API:
HighlightItemdataclass and extendedhighlight_many()— supportshl_linesandshow_linenosfor full parallel batch highlighting
- HTML Formatter: Pre-compute prefixed span templates from class name mappings instead of parsing HTML strings at runtime — fixes a fragility in the hot path
- HTML Formatter: Extract
_format_with_hl_lines()and_resolve_span_table()fromformat()for better maintainability of the line-highlighting slow path - Theme Registry: Eager initialization of palette registry at module scope
with
threading.Lockonregister_palette()— closes a thread-safety gap - CI: Replace mypy with ty in the typecheck workflow to match project tooling
- Core API:
_validate_range()bounds checking forstart/endparameters inhighlight()andtokenize()— raisesValueErroron invalid ranges
- Dead
TYPE_CHECKINGblock in HTML formatter
0.1.0 - 2026-01-02
Initial public release of Rosettes, extracted from the Bengal static site generator.
-
Core API
highlight()— Generate formatted output with syntax highlightingtokenize()— Get raw tokens for custom processinghighlight_many()— Parallel highlighting for multiple blockstokenize_many()— Parallel tokenization
-
Formatter Registry
get_formatter()— Get formatter by name or aliaslist_formatters()— List all supported formatterssupports_formatter()— Check formatter support- Built-in formatters: HTML, Terminal, Null
-
Lexer Registry
get_lexer()— Get lexer by name or aliaslist_languages()— List all supported languagessupports_language()— Check language support
-
55 Language Lexers
- Hand-written state machines with O(n) guaranteed performance
- Zero ReDoS vulnerabilities
- Languages: Python, JavaScript, TypeScript, Rust, Go, C, C++, Java, Kotlin, Ruby, and 45 more
-
Styling Features
- Semantic CSS classes (
.syntax-keyword,.syntax-function, etc.) - Pygments-compatible classes (
.k,.nf, etc.) - Line highlighting with
hl_lines - Line numbers with
show_linenos
- Semantic CSS classes (
-
Python 3.14t Support
- Designed for free-threading (PEP 703)
- Declared GIL-free safety via
_Py_mod_gil - Thread-safe by design: lexers use only local variables
- Pure Python — no runtime dependencies
py.typedmarker for type checking- Comprehensive test suite