Literate.jl icon indicating copy to clipboard operation
Literate.jl copied to clipboard

use compact mode when printing by default

Open Roger-luo opened this issue 3 years ago • 3 comments

currently, when executing the Literate script, it redirects the IO to a buffer

https://github.com/fredrikekre/Literate.jl/blob/master/src/Literate.jl#L495

this is not very consistent with what people will see in a REPL and could be inconvenient if it is built with web pages. It would be nice to have an IOContext that has :compact=>true as default, or at least have an option for this

Roger-luo avatar Jan 14 '22 01:01 Roger-luo

See #127, https://github.com/tkf/DisplayAs.jl/pull/14.

fredrikekre avatar Jan 24 '22 15:01 fredrikekre

ah thanks!

Roger-luo avatar Jan 24 '22 20:01 Roger-luo

@fredrikekre I think DisplayAs doesn't really solve this problem, one need to use that explicit which is not this issues describes - shouldn't the default text/plain output be consistent with REPL? this currently frequently blow up the outputs for me when there is a large array, while everything works just fine in REPL. I think at least the printing should use :compact=>true by default which respects the printing protocols

Roger-luo avatar Apr 19 '22 03:04 Roger-luo