-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with directories #228
Comments
Not sure as to the root cause, but this issue can be avoided by using the # run-from-root.jl
using Literate
Literate.markdown(
joinpath(@__DIR__, "docs", "sample.jl"),
joinpath(@__DIR__, "other");
execute=true,
flavor=Literate.CommonMarkFlavor()
) # docs/run-from-docs.jl
using Literate
Literate.markdown(
joinpath(@__DIR__, "sample.jl"),
joinpath(@__DIR__, "..", "other");
execute=true,
flavor=Literate.CommonMarkFlavor()
) |
This patch fixes a bug where `Literate.markdown` with `execute=true` would (try to) output images in the wrong directory. This only occured when passing a relative output directory. Fixes #228.
This patch fixes a bug where `Literate.markdown` with `execute=true` would (try to) output images in the wrong directory. This only occured when passing a relative output directory. Fixes #228.
Thanks for the report, this is fixed in release 2.15.1 (JuliaRegistries/General#94947 for the registry PR) by 7fc9958 When executing code Literate I tend to always be explicit about paths and use absolute paths though, but it should of course work otherwise as well. |
The issue I see here is that by
...in my input file, it tries to look for a |
I am sure there are arguments for both options, I just copied the behavior from Documenter. The current behavior is nice if you save files, for example, since they end up where the code is executed. |
I see. Yes, that makes sense. The flip side is, of course, what happens if the script needs to read input files. I'm trying to keep my input files and output files in completely different directories. One option could be for the |
OK, I resolved it for myself at least. |
I've created the following repo that demonstrates an issue I'm seeing. I'm getting errors of the form:
...and I cannot understand why. The
README
in the repo explains exactly how to reproduce the issue but the bottom line is that when running scripts from different directories, the behavior ofLiterate.jl
seems to change although it isn't obvious to me why.Am I doing something obviously wrong? The scripts are nearly identical, the only difference that I can really see is whether the file being executed is in the current directory or not.
The text was updated successfully, but these errors were encountered: