-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functions to style text (colors, weight, etc) #140
base: main
Are you sure you want to change the base?
Conversation
Maybe this API is a better idea because it looks more like Ruby: stylize("Hi!").red.on_white.bold In this case, |
First of all, thanks for doing this! When I first read this PR, I also thought of this API :) Want to go for it? Also, can you extract some constants like |
Yeah, I'll let you know when I'm done refactoring. |
c5934e3
to
ad75bc1
Compare
Hey @cllns, I'm done refactoring and I think that the solution is better now, what you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that refactoring! In reviewing it, I found a few more we can do as well
- Changed the API to `stylize("string").bold.blue.on_white` - Moved magic numbers to constants - Improve code reuse and legibility
ad75bc1
to
d8f3907
Compare
Thanks for the feedback! Can you review it again, please? |
Inspired by the issue #121, I added a module with functions to change text style. The doc
docsite/source/styling-your-output.html.md
demonstrate how it works. I used thethor
implementation as a basis, but I changed the API to make combinations shorter:Resolve #121