I’m regularly using
@doc read(joinpath(dirname(@__DIR__), "README.md"), String) MyModule for the (sub)module documentation. Unfortunately @DIR doesn’t behave like documented
Base.@__DIR__ — Macro
@__DIR__ -> AbstractString
Expand to a string with the absolute path to the directory of the file containing the macrocall. Return the current working directory if run from a REPL or if evaluated by
julia -e <expr> .
The doc states directory of the file containing the macrocall. But in case the file was included(), this is not true. It is the file that created the global context. Is that expected?
Since @DIR doesn’t reliably provide the directory of the source file, is there some other means I can use?