Auto-generated documentation from Rosettes source code.
Browse the complete API with docstrings, type annotations, and source links.
Modules
Formatters
Rosettes formatters package.
Contains output formatters for different targets (HTML, terminal, etc.).
Available Formatters:
HtmlFormatter: HTML output with semantic or Pygments-compatible CSS classesTerminalFormatter:...
Lexers
Rosettes lexers package.
All lexers are hand-written state machines with O(n) guaranteed performance and zero ReDoS vulnerability.
Themes
Rosettes themes package.
Semantic token system for syntax highlighting with modern CSS support. Provides palettes, CSS generation, and accessibility validation.
Design Philosophy:
Rosettes uses a semantic role system instead...
Quick Links
| Module | Description |
|---|---|
rosettes |
Main package —highlight(), tokenize(), highlight_many() |
rosettes.formatters |
HTML formatter implementation |
rosettes.lexers |
Language lexer state machines |
rosettes.themes |
Theme and palette definitions |
See Also
- Hand-written API Reference — Curated API documentation with examples
- Token Types — Complete TokenType enum reference
- Supported Languages — All 55 languages