LuxDL / DocumenterVitepress.jl

Documentation with Documenter.jl and VitePress
https://luxdl.github.io/DocumenterVitepress.jl/
MIT License
61 stars 9 forks source link

@repl or @ansi #99

Open lazarusA opened 3 months ago

lazarusA commented 3 months ago

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 😄 ).

asinghvi17 commented 3 months ago

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...

lazarusA commented 3 months ago

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
asinghvi17 commented 2 months ago

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...