While writing documentation, I am making large use of the @repl blocks with Documenter.jl. However, it seems that these blocks are not expanded automatically in the REPL or in Jupyter.
Is there a way to expand the @repl blocks in the REPL, when accessing the documentation with ? ?
Nope. The evaluation of at-repl blocks is provided by Documenter, so base Julia doesn’t know anything about them. Also, note that Documenter does not evaluate at-repl blocks that are in docstrings either (just the ones on Markdown pages).
Theoretically, one could implement some sort of DocStringExtensions-like approach for this. But this requires the code to actually be evaluated when you pull up docstrings, and that can be expensive, and I feel that this will likely be a footgun, often leading to bad UX.
Instead, you should use doctests for this. Documenter can help you keep them up to date.
Thanks! Yeah, I feared so. Manually updating a bunch of jldoctests felt painful. I didn’t know that you could have Documenter to fix them automatically, thanks!