-
Notifications
You must be signed in to change notification settings - Fork 480
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
enable colored print for REPL output #1691
Conversation
Won't be enabled for doctests (so I believe this should be safe).
Regarding doctests, how about producing colored output but stripping it before the comparison is made? I guess some people would not want that but it could be optional? |
So that people can do something like ? julia> printstyled("red"; color=:red)
\e[31mred\e[39m Honestly, I'm not super willing to support it. Maybe we can delay the support to the future until when someone finds it useful ? |
No, I meant so that people can still do: ```jldoctest
julia> @test 1==1
Test Passed
``` but have |
Ah, I see. But it seems it requires much refactors in order to replace the contents of generated document with the actual outputs of doctests. |
It was probably bad form of me to comment on this PR. It wasn't really meant as anything that should be done here, it was just a related thought I hade when I read the PR description. I should just open a separate issue. |
Do you have an example of what this enables? |
I see. Thanks for the clarification :)
An object may implement its own ```@repl; ansicolor=true
struct Foo end
Base.show(io::IO, ::Foo) = printstyled(io, "Foo"; color = :blue)
Foo()
``` |
@KristofferC so can this get merged (and maybe can we tag a patch release) ? |
Can you add a note in the changelog? |
Sure. Added. |
26608da
to
6fed1c3
Compare
Won't be enabled for doctests (so I believe this should be safe).