-
Notifications
You must be signed in to change notification settings - Fork 63
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
[enhancement] Use different color for command usage examples within messages #243
Comments
I would like to do this if you alllow. |
@nikochiko Is it okay if I make a new interface.py in evalai/util containing the parsed echo function or can you please suggest me the way it is wanted. |
@ShubhamPandey28 I think these changes should go either along with or after the enhancements proposed in #234 as this can make use of the additions proposed there. So it would be better if that issue is resolved first, and then we come to this. For example, I was thinking of having a syntax like: def error_style(message): # from 234 !?
return style(message, bold=True, fg="red")
def command_style(command): # from 234 !?
return style(command, bold=True, fg="cyan")
def prettify_error_with_command(message):
## incorporate both above methods here ##
# Usage:
echo(prettify_error_with_command(MESSAGE)) The approach mentioned in issue#234 recommends directly echoing the messages, which would make it harder to use both side-by-side. What do you think? @ShubhamPandey28 @takitsuse |
@ShubhamPandey28 Yes, you are on the right track. Both changes should be made in the same file like interface.py |
For printing things in multiple colors, @nikochiko's edit on proposal #234 looks reasonable. Sounds good to me👍 |
Current Behaviour:
When a command is to be shown in a message as a usage example, the current way is to use backticks (`) to enclose it. This is hard to read as the rest of the message is of the same color.
Expected Behavior:
Use a different color for the commands and a different color for the rest of the message. This should be done by using a function to parse the string, fetch the substring within the backticks (`) and return a complete message as expected with the part in backticks being shown in a different color.
That is:
As red, yellow, white and green are used for other types by convention, I think cyan (as shown above) can be a good choice.
The text was updated successfully, but these errors were encountered: