I’ve searched this topic but could not find any solution to what it seems to be it should be a pretty common need.
I have several man pages of programs that share common options. For obvious reasons I would like to avoid having to copy the same text over and over again to each individual .md file (and change them the same number of times when something is updated). In RST one can simply .. include:: common but this seems not to be possible with Markdown.
@mike Thanks for the quick update on the situation but for me, only wanting to suffer horribly with docs, it seems easier to … drop Documenter and go back to RST.
You could even define it as a function to reduce the boilerplate in the at-eval block.
Is it also possible to create a custom macro that one can call then instead of @eval? The use case would be to do, e.g., @_ref(StaticArrays.jl) inside a normal documentation text in order to workaround this limitation: How to use Markdown reference links with Documenter.jl…
Technically, yes, but it becomes a little non-trivial. You would have to look at how we implement the various at-blocks in the Expanders pipeline (side note: they have nothing to do with Julia macros). Off the top of my head, I am not sure if something as simple as setting page.mapping[x] to some Markdown AST would work.
Frankly, I don’t think it’s worth the effort, unless you’re implementing some more complex at-block. Also, all those internals are non-public, and while they’ve been rather stable over the years, they may break at any time (if everything works out, I hope to have some major breakage here in 0.28).