JuliaDocs / Documenter.jl

A documentation generator for Julia.

Home Page:https://documenter.juliadocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't emit ANSI strings from `@example` block in custom writer

asinghvi17 opened this issue · comments

Hey, I was working on DocumenterVitepress.jl and was trying to figure out why example blocks were not returning ANSI strings. Turns out that the answer is here:

https://github.com/JuliaDocs/Documenter.jl/blob/3e6129d77da0150ba9851a2aa1c541d4b818e8fb/src/expander_pipeline.jl#L700C1-L704C4

and I was wondering whether it makes sense to refactor this code so that each Documenter writer has a "trait" as to whether it accepts ANSI or not. It would also be nice to somehow bake ANSI support into the language section of the output code block as well.

This seems like a pretty trivial change to me but wanted to get the maintainers' thoughts before doing it!

Yeah, some method overload seems like a good idea here, definitely open to that.

It would also be nice to somehow bake ANSI support into the language section of the output code block as well.

I am not quite sure what you mean here?