Skip to content

Commit 6c92d59

Browse files
authored
Merge pull request #1904 from JuliaDocs/mp/mktempdir
2 parents 76cdebf + d700d80 commit 6c92d59

File tree

2 files changed

+5
-44
lines changed

2 files changed

+5
-44
lines changed

src/Writers/LaTeXWriter.jl

+5-10
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,9 @@ const DOCUMENT_STRUCTURE = (
101101
"subparagraph",
102102
)
103103

104-
# https://github.com/JuliaLang/julia/pull/32851
105-
function mktempdir(args...; kwargs...)
106-
return Base.mktempdir(args...; cleanup=false, kwargs...)
107-
end
108-
109104
function render(doc::Documents.Document, settings::LaTeX=LaTeX())
110105
@info "LaTeXWriter: creating the LaTeX file."
111-
Base.mktempdir() do path
106+
mktempdir() do path
112107
cp(joinpath(doc.user.root, doc.user.build), joinpath(path, "build"))
113108
cd(joinpath(path, "build")) do
114109
fileprefix = doc.user.sitename
@@ -150,7 +145,7 @@ function render(doc::Documents.Document, settings::LaTeX=LaTeX())
150145
# Debug: if DOCUMENTER_LATEX_DEBUG environment variable is set, copy the LaTeX
151146
# source files over to a directory under doc.user.root.
152147
if haskey(ENV, "DOCUMENTER_LATEX_DEBUG")
153-
dst = isempty(ENV["DOCUMENTER_LATEX_DEBUG"]) ? mktempdir(doc.user.root) :
148+
dst = isempty(ENV["DOCUMENTER_LATEX_DEBUG"]) ? mktempdir(doc.user.root; cleanup=false) :
154149
joinpath(doc.user.root, ENV["DOCUMENTER_LATEX_DEBUG"])
155150
sources = cp(pwd(), dst, force=true)
156151
@info "LaTeX sources copied for debugging to $(sources)"
@@ -179,7 +174,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
179174
piperun(`latexmk -f -interaction=nonstopmode -view=none -lualatex -shell-escape $(fileprefix).tex`, clearlogs = true)
180175
return true
181176
catch err
182-
logs = cp(pwd(), mktempdir(); force=true)
177+
logs = cp(pwd(), mktempdir(; cleanup=false); force=true)
183178
@error "LaTeXWriter: failed to compile tex with latexmk. " *
184179
"Logs and partial output can be found in $(Utilities.locrepr(logs))." exception = err
185180
return false
@@ -192,7 +187,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
192187
piperun(`$(tectonic) -X compile --keep-logs -Z shell-escape $(fileprefix).tex`, clearlogs = true)
193188
return true
194189
catch err
195-
logs = cp(pwd(), mktempdir(); force=true)
190+
logs = cp(pwd(), mktempdir(; cleanup=false); force=true)
196191
@error "LaTeXWriter: failed to compile tex with tectonic. " *
197192
"Logs and partial output can be found in $(Utilities.locrepr(logs))." exception = err
198193
return false
@@ -212,7 +207,7 @@ function compile_tex(doc::Documents.Document, settings::LaTeX, fileprefix::Strin
212207
piperun(`docker cp latex-container:/home/zeptodoctor/build/$(fileprefix).pdf .`)
213208
return true
214209
catch err
215-
logs = cp(pwd(), mktempdir(); force=true)
210+
logs = cp(pwd(), mktempdir(; cleanup=false); force=true)
216211
@error "LaTeXWriter: failed to compile tex with docker. " *
217212
"Logs and partial output can be found in $(Utilities.locrepr(logs))." exception = err
218213
return false

test/examples/mkdocs.yml

-34
This file was deleted.

0 commit comments

Comments
 (0)