chalkdart 3.1.0
chalkdart: ^3.1.0 copied to clipboard
Console/Logging text coloring and styling library for Dart. 'Terminal string styling done right' The default mode uses ANSI codes to style the text for Console/Terminal display. HTML mode can be activ [...]
ChalkDart Change Log #
3.1.0 #
- Performance optimization release — significant speed improvements across all major code paths.
- String Extension Getters — 7-10x faster (base16 and X11/CSS colors)
- X11/CSS String Extension Getters — 3-4x faster via list-based cache
- Chalk Getter Chains — 4-6x faster
- ANSI SGR Code Generation — cached
- Multi-line Text Processing — 4-6x faster
- Hex Color Parsing — 13x faster
- Added
PERF_RECOMMENDATIONS_AND_IMPROVEMENTS.mdwith practical performance guidance for library users - Added comprehensive performance benchmark suite under
test/perf_*.dart - Expanded test coverage from 493 to 515 tests
3.0.6 #
- setDefaultOutputMode now re-initializes the chalkstrings also
- Move args package dependency to dev-dependencies
- clean up dart analyze messages
- expand dart test from 7 to 493
3.0.5 #
- Added xterm() method as alternate way of creating ANSI/Xterm colors (instead of using ansi() or onAnsi())
- Added export of src/chalk_x11.g.dart to package:chalkdart/chalkstrings.dart so that color extensions are available for chalk as well as the string extensions.
- Added [AnsiStringUtils] String extension to ansiutil.dart for with [lengthWithoutAnsi] and [stripAnsi] getters so the length of a string not including hidden ansi codes can be calculated, or the codes can be removed.
- Change to \x1B instead of \u001B for shorter strings and slightly faster parsing
3.0.4 #
- Add TLDR summary to readme
3.0.3 #
- Remove error from README about makeRGBChalk()
3.0.2 #
- Remove html_character_entities dependency and add that code locally
3.0.1 #
- Fix minor error of old ChalkWhitespaceStyle instead of ChalkWhitespaceTreatment
- Added note about being about to use any valid
white-spaceCSS value for [whiteSpaceTreatment]
3.0.0 #
- add support for HTML output mode with new supporting methods for Chalk and Chalk string support The intention of this is to allow the use of Chalk for loggers which may be sending output to a server/database for viewing in a browser or other html capable viewer. The viewed HTML will appear as it does in the VSCode debug console.
New HTML Output Features:
-
Output Mode Control:
Chalk.setDefaultOutputMode = ChalkOutputMode.htmlto set default mode to html for future constructed Chalk objectschalk.setOutputMode = ChalkOutputMode.htmlto set the output mode on an existing Chalk object- Use [ChalkOutputMode.ansi] to change back to ANSI mode (default unless explicitly set to html)
-
Color Scheme Support:
Chalk.defaultHtmlBasicANSIColorSetproperty for setting default color schemeChalk.setDefaultHtmlBasicANSIColorSetmethod for changing color scheme- Available schemes: [ChalkAnsiColorSet.lightBackground], [ChalkAnsiColorSet.darkBackground], [ChalkAnsiColorSet.highContrast]
-
HTML Safety Methods:
chalk.stripHtmlTags()- Removes HTML tags from textChalk.htmlSafeSpaces()- Preserves spaces in HTML outputChalk.htmlSafeGtLt()- Converts < and > to HTML entitiesChalk.htmlSafeEntities()- Converts all HTML special characters to entities
-
Stylesheet Generation:
chalk.stylesheet()- Generates CSS styles for HTML outputchalk.inlineStylesheet()- Generates CSS wrapped in
