mirror of https://github.com/mpastell/Weave.jl
avoid manipulation of global struct
parent
101b170ea6
commit
249c94a5c1
|
@ -47,11 +47,10 @@ function run_doc(
|
|||
# cache :all, :user, :off, :refresh
|
||||
|
||||
doc.doctype = isnothing(doctype) ? (doctype = detect_doctype(doc.source)) : doctype
|
||||
doc.format = formats[doctype]
|
||||
|
||||
if haskey(doc.format.formatdict, :keep_unicode)
|
||||
doc.format.formatdict[:keep_unicode] = latex_keep_unicode
|
||||
end
|
||||
doc.format = deepcopy(formats[doctype])
|
||||
|
||||
doc.cwd = get_cwd(doc, out_path)
|
||||
isdir(doc.cwd) || mkpath(doc.cwd)
|
||||
|
|
|
@ -89,15 +89,15 @@ content = """
|
|||
# Test chunk
|
||||
α
|
||||
"""
|
||||
chunk = Weave.DocChunk(content, 1, 1)
|
||||
fmt = deepcopy(Weave.formats["md2tex"])
|
||||
fmtdict = fmt.formatdict
|
||||
|
||||
dchunk = Weave.DocChunk(content, 1, 1)
|
||||
|
||||
pformat = Weave.formats["md2tex"]
|
||||
|
||||
f = Weave.format_chunk(dchunk, pformat.formatdict, pformat)
|
||||
f = Weave.format_chunk(chunk, fmtdict, fmt)
|
||||
@test f == "\\section{Test chunk}\n\\ensuremath{\\alpha}\n\n"
|
||||
pformat.formatdict[:keep_unicode] = true
|
||||
f = Weave.format_chunk(dchunk, pformat.formatdict, pformat)
|
||||
|
||||
fmtdict[:keep_unicode] = true
|
||||
f = Weave.format_chunk(chunk, fmtdict, fmt)
|
||||
@test f == "\\section{Test chunk}\nα\n\n"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue