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

Document how to modify IOContext parameters in outputs

Open mortenpi opened this issue 2 years ago • 2 comments

I.e. number of columns of the REPL output etc. -- would be good to have a short how-to guide for this in the docs. Related issues:

  • https://github.com/JuliaDocs/Documenter.jl/issues/1450
  • https://github.com/JuliaDocs/Documenter.jl/issues/942

@fredrikekre: in reference to https://github.com/JuliaDocs/Documenter.jl/issues/1450, how do you imagine the user using DisplayAs.(set|with)context in Documenter? Explicitly call it in the at-example/repl block? I.e. something like this?

```@example
f() = collect('a':'z') # hide
f() |> DisplayAs.withcontext(...)
```

mortenpi avatar Aug 14 '23 02:08 mortenpi

It would be great to have these as "keyword arguments" to the example/repl blocks as well - as well as maybe some defaults on the page level, settable via @meta. That way there is less of a barrier to entry - and people can easily opt in, versus googling to get to DisplayAs and then installing the package, making sure it's used (and hidden) in every example environment, etc.

asinghvi17 avatar Jun 14 '24 18:06 asinghvi17

Yes, they should be keywords. We also got https://github.com/JuliaDocs/IOCapture.jl/pull/26 now, so it should be possible to pass these on pretty easily.

One first step towards all that would be to harmonize the parsing on the at-block arguments. I would like there to be a single function that you pass the "language" attribute string (i.e. @example foo; x = 2, y = 3) and it returns a data structure that has the parsed arguments.

mortenpi avatar Jun 26 '24 03:06 mortenpi