I think @repl itself tries to mimic Julia REPL, thus it would make sense to ask its output to mimic the terminal, which for example the ASCII color characters should work at least.
This currently doesn't work since Documenter directly append the output string to the same code block with the source code, thus it only contains syntax highlighting powered by
highlight.js .
I just realize one solution is using https://juliadocs.github.io/ANSIColoredPrinters.jl/dev/
but maybe it would be nice to make it default for @repl?
I think #1441 implements what you describe?
Most helpful comment
I think #1441 implements what you describe?