Sorry, I thought there could have been a built-in solution. I realised we go back to this discussion about adding a callback (and this pull request) to custom preprocess the documentation source.
In that case, I ended up implementing it by using temporary files/directories in the make.jl
file, but a simple custom function string preprocessing would be much simpler both to implement (that pull request was just 12 line changes) and to use (I have no idea how to implement it at the AST level as suggested by @mortenpi , it seems much more complex…)…