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

@repl or @ansi

Open lazarusA opened this issue 1 year ago • 3 comments

should we call @ansi if the lang is repl, and of course only if the user is using DocumenterVitepress ? otherwise no nice printing will be available for them, and replacing everywhere @repl for @ansi is just a pain (from experience 😄 ).

lazarusA avatar Apr 01 '24 11:04 lazarusA

We can't do that on our end unless we override REPL handling afaict. Probably better to figure out how HTMLwriter is getting ANSI and go from there...

asinghvi17 avatar Apr 01 '24 11:04 asinghvi17

mmm.... I was thinking something around this level:

function intelligent_language(lang::String)
    if lang == "ansi"
        "julia /julia>/"
    elseif lang == "documenter-ansi"
        "ansi"
    elseif lang == "documenter-repl" # here? no... 😄 
        "ansi"
    else
        lang
    end
end

lazarusA avatar Apr 01 '24 11:04 lazarusA

In this case, I suspect we would have to do highlighting manually. We could write a backend ("formatter") for Highlights.jl to disgorge the appropriate highlight...

asinghvi17 avatar Apr 02 '24 15:04 asinghvi17

Done by #253

asinghvi17 avatar May 14 '25 20:05 asinghvi17