package ansifmt
A simple, lightweight library for ANSI formatting
Install
dune-project
Dependency
Authors
Maintainers
Sources
ansifmt-0.3.0.tbz
sha256=2aafe8c72c1112b95b4b13be7f070d8fa0618a9414a85c3fb395a0ea3b5ace29
sha512=394320608cd6ffffb68c1b20d593d42929e155678be2adc3f43e86900adcadab50758ff53d91aa770259c302784064782c89b8d623016e370421a702755350ee
doc/CHANGES.html
0.3.0
Features
- Add
Customtoken type variant which takes a styling, for tokens without particular semantics. - Add
Formatting.Elementthat supersedesFormatting.Tree. - Add
Formatting.Interfaces.TO_ELEMENTinterface which establishes the contract to convert to a formatting element that is used by formatting and printing utilitary functions such asformatandIO.print_formatted. - Expose the
Int8module that is used byColor. - Add
Token.numberto easily construct a number literal token.
Removed
- Remove
Formatting.Tree,Formatting.TOKENIZABLEand its associated functions. UseFormatting.Elementinstead. - Remove the
Preludemodule. It has merged with the coreAnsifmtmodule. - Remove
print_formattedalias from the prelude. The function can still be found asIO.print_formatted. - Remove
make_stylingalias from the prelude. The function can still be found asStyling.create.
Internal
- Renamed
UtilstoInternal. Formattingis now a directory instead of a file containing all its submodules.- Added
List.intersperseandList.singleton(used inFormatting.Element). - Added
Bool.tautology(used inFormatting.Element).
0.2.0
Features
- Add color functions
luminanceandbest_for_contrast. (by @chshersh in #5) - Add styling functions
fg,bg,bold,dim,italic,underlined. (by @chshersh in #6) - Add styling composition with
&. (by @chshersh in #6) - Add function
make_rgb_hexto parse hexadecimal codes into RGB colors. (by @chshersh in #7)
Breaking Changes
Color.tandColor.Ground.tare now polymorphic variants. (by @chshersh in #5)
Removed
Util.parenthesize_ifwhich is deemed unuseful and is kind of a duplicate ofTree.parenthesize_ifinFormatting.
0.1.3
Fixes
- Fixed a bug where unwanted
mcharacters would appear in the output before every colored token
0.1.2
Fixes
- Moved
Formatting.tokenizeandFormatting.formatto a dedicatedFormatting.Utilsubmodule - it is common for users who wish to implementTOKENIZABLEtoopen Formatting, andFormatting.tokenizewould then shadow the user's own function, making it cumbersome if the latter was recursive. This does not affect theAnsifmtprelude -formatstays available.
0.1.1
Features
- Added
print_formattedand theIOsubmodule.
0.1.0
First pre-release.