Emma Boudreau
Jul 2, 2022

--

Luckily, you do happen to be missing something !

If you do a ctrl+F and search for Base.TTY in this article, I briefly mention that this is the name for the Julia REPL's output.

The solution to your problem would be dispatching show(t::Base.TTY, m::MIME{Symbol("text/markdown")}, s::String). Also, ensure that you have explicitly directly imported Base.show, as you can make a new function with a singular new method by accident if you don't. This example would do what you are trying here:

julia> using Markdown

julia> import Base: show

julia> show(t::Base.TTY, m::MIME{Symbol("text/markdown")}, s::String) = display(Markdown.parse(s))

show (generic function with 263 methods)

julia> display("text/markdown", "# Hello world!")

Hello world!

≡≡≡≡≡≡≡≡≡≡≡≡≡≡

julia>

edit: Also, the MethodError's beauty is shown here very well :)

--

--

Emma Boudreau
Emma Boudreau

Written by Emma Boudreau

i am a computer nerd. I love art, programming, and hiking. https://github.com/emmaccode

No responses yet