This PR makes the rendering IOContext available to interpolated Julia objects. Example of using the IO context in an HTML render:
struct MyType
end
function Base.show(io::IO, m::MIME"text/html", x::MyType)
if get(io, :limit, false) === true
write(io, "hello")
else
write(io, "<marquee> hello hello hello </marquee>")
end
end
Hey Michael 👋
This PR makes the rendering IOContext available to interpolated Julia objects. Example of using the IO context in an HTML render:
This PR will fix https://github.com/fonsp/Pluto.jl/issues/1807 , because Pluto and https://github.com/JuliaPluto/AbstractPlutoDingetjes.jl use IOContext to communicate which Pluto API is available to the renderer.
This PR is similar to https://github.com/JuliaPluto/HypertextLiteral.jl/pull/27
Example notebook that works after this PR: