Closed chenspc closed 3 years ago
Hey! Pluto does not support ASCII color characters (since it is not a terminal), which we declare using the IOContext. (We won't support color characters because we support HTML+CSS output.) Packages should use the IOContext to find out whether colored printing is supported, before writing ANSI codes to the io stream.
Take a look at a very similar PR that I submitted https://github.com/SciML/SciMLBase.jl/pull/30. Note that for this PR, I tried to minimize code changes, but ideally you would use Base.printstyled
or Crayons.jl
to make this automatic. (At least, I assume that these handle the :color
setting, I haven't tried it.)
In the particular case of Configurations.jl: Note that Pluto has a really nice built-in viewer for structs, which uses similar color and indentation, except you can collapse the tree. You might want to consider disabling the custom show method inside Pluto. (The official way is to use isdefined(Main, :PlutoRunner)
to check for Plutoness)
@Roger-luo
It looks like this is an issue with Crayons.jl -- it should check the :color
setting.
I haven't looked into this, but I'm thinking to provide a show
method for HTML specifically which should solve this problem.
On the other hand, we should file an issue for Crayons?
I ran into a printing problem when using Configuration.jl in Pluto. See also Roger-luo/Configurations.jl#18. The package author said
Is this something that will be added in the future, or are there any suggested workarounds? Thanks!