Skip to content
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

[BUG] fig_path gets overwritten for 2html doctypes #358

Closed
feanor12 opened this issue May 30, 2020 · 3 comments · Fixed by #359
Closed

[BUG] fig_path gets overwritten for 2html doctypes #358

feanor12 opened this issue May 30, 2020 · 3 comments · Fixed by #359
Labels

Comments

@feanor12
Copy link

Using fig_path when weaving to md2html does not work

(@v1.4) pkg> status Weave
Status `C:\Users\mpus\.julia\environments\v1.4\Project.toml`
  [44d3d7a6] Weave v0.10.2
julia> versioninfo()
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "C:\Users\mpus\AppData\Local\Programs\Microsoft VS Code\Code.exe"
  JULIA_NUM_THREADS = 2

Example:
test.jmd

    ```julia 
    using Plots
    plot(rand(10))
    ```

REPL

weave("test.jmd", doctype="md2html", out_path= joinpath(pwd(),"out"),cache=:all,fig_path="fig")
readir("out")

Output of readdir:

3-element Array{String,1}:
 "cache"
 "jl_tG4P2M"
 "test.html"

The folder "jl_tG4P2M" is created instead of fig.
Also if I rerun the command to weave I get a new random folder.
This is a problem when I am running weave in a loop to update my html file as I create a lot of folders.

I think the reason can be found here

Weave.jl/src/run.jl

Lines 50 to 54 in 1e9ba19

doc.cwd = get_cwd(doc, out_path)
isdir(doc.cwd) || mkpath(doc.cwd)
if (occursin("2pdf", doctype) && cache == :off) || occursin("2html", doctype)
fig_path = mktempdir(abspath(doc.cwd))
end

As far as I understand it the fig_path parameter is overwritten without giving an warning or an option to avoid it.

Would it be possible to use the same folder or clear it after the run?

@feanor12 feanor12 added the bug label May 30, 2020
@aviatesk
Copy link
Member

yeah, it seems like a bug. Well, those temporary folders will be cleaned up after you exited a running session, but we should respect given fig_path I think.

aviatesk added a commit that referenced this issue May 30, 2020
@aviatesk
Copy link
Member

can you try ] add Weave#master and report back ?

@feanor12
Copy link
Author

Seems to work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants