Repository navigation
v0.11.0: Nice Errors Man
...shut up. Regardless,
Changelog
All notable changes to Farben will be documented here.
[0.8.0] - 2026-04-04 - farben-core
Added
RegistryErrorenum — a separate error type for registry operations (set_prefix,insert_style).
Split out fromLexErrorbecause registry errors have no source position (they occur outside markup
parsing). Has one variant:UnknownStyle(String).LexErrorDisplay<'a>struct — wraps a&LexErrorand the original&strinput to produce
compiler-style diagnostic output. Renders two lines: the full input string, then a caret (^)
aligned to the byte offset of the error. Example:| [bold unknown]text | ^^^^^^^ invalid tag: 'unknown'
Changed
- All
LexErrorvariants now carry aposition: usizefield (byte offset into the markup string).
Affected variants:UnclosedTag,InvalidTag,UnclosedValue,InvalidArgumentCount,
InvalidValue,InvalidResetTarget. Previously no variants stored position info. LexError::UnknownStyleremoved — registry errors now useRegistryError::UnknownStyleinstead.LexError'sDisplayimpl now includes position in every message
(e.g."invalid tag 'foo' at position 5").
[0.11.0] - 2026-04-04 - farben
Added
farben::preludemodule - the recommended import path going forward.use farben::prelude::*
brings every user-facing item into scope (functions, macros, types) gated by the same feature
flags as their definitions. Prefer this overuse farben::*, which also pulls in
color_runtimeandvalidate_color- items that arepubonly to satisfy macro expansion,
not intended for direct use.
Changed
farben-coredependency bumped to0.8.0, picking up position-awareLexErrorvariants and
the newLexErrorDisplaydiagnostic formatter.try_colorerror messages now include the byte
offset of the offending token.- All documentation and examples updated to use
use farben::prelude::*.