Thank you, I solved.
It was due to this:
"""
_include_sandbox(filename)
Include the `filename` in a temporary module that acts as a sandbox. (Ensuring
no constants or functions leak into other files.)
"""
function _include_sandbox(filename)
mod = @eval module $(gensym()) end
return Base.include(mod, filename)
end
[...]
# `include` the file to test it before `#src` lines are removed. It is
# in a testset to isolate local variables between files.
@testset "$(filename)" begin
_include_sandbox(filename)
end
Actually I understood now that the code was running twice! Once for the above testset, and once as an example block in Documenter.
By commenting the code above and using the codefence keyword in Literate.Markdown
I managed to get the documentation buildwithout running the code, thanks.