chalk-box alternatives and similar shards
Based on the "Misc" category
Do you think we are missing an alternative of chalk-box or a related project?
Terminal toolbox to paint and embroider :)
Colorize is the obvious choice for those who are starting coding on Crystal. However it changes the String class, and that's not a good practice.
Besides that, it doesn't offer ways to handle multiple types of terminal.
Obs: Yes, this lib is similar to the chalk lib from Node.js. The differences are:
- This lib is written in Crystal (oh really?);
- All-in-one (the style and support modules are integrated);
- This lib doesn't support 256 and TrueColor for now.
Add this to your application's
dependencies: chalk_box: github: azukiapp/crystal-chalk-box
require "chalk_box" module Basic extend ChalkBox extend self def main puts chalk.green("green fields") end end Basic.main
Chain styles and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that
chalk.red.yellow.green is equivalent to
Color support is automatically detected, but you can override it by setting the
For default enable is instance of
Detect whether the terminal supports color. Used internally and handled for you, but exposed for convenience.
Can be overridden by the user with the flags
--no-color. For situations where using
--color is not possible, add an environment variable
FORCE_COLOR with any value to force color. Trumps
italic(not widely supported)
strikethrough(not widely supported)
blue(on Windows the bright version is used as normal blue is illegible)
- Add examples for
- Add examples for
- Add support for 256 colors;
- Add support for truecolor;
- Fork it ( https://github.com/azukiapp/crystal-chalk-box/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- nuxlli Everton Ribeiro - creator, maintainer
"Azuki", "azk" and the Azuki logo are copyright (c) 2013-2016 Azuki Serviços de Internet LTDA.
azk source code is released under Apache 2 License.
Check LEGAL and LICENSE files for more information.
*Note that all licence references and agreements mentioned in the chalk-box README section above are relevant to that project's source code only.