make Weave.path really path

pull/365/head
Shuhei Kadowaki 2020-06-10 01:09:31 +09:00
parent 8515c0dcde
commit cdd653e028
3 changed files with 4 additions and 3 deletions

View File

@ -304,7 +304,7 @@ function include_weave(
)
old_path = pwd()
doc = WeaveDoc(source, informat)
cd(doc.path)
cd(dirname(doc.path))
try
code = join(
[x.content for x in filter(x -> isa(x, Weave.CodeChunk), doc.chunks)],

View File

@ -2,7 +2,8 @@ using YAML
function WeaveDoc(source, informat = nothing)
path, fname = splitdir(abspath(source))
path = abspath(source)
_, fname = splitdir(path)
basename = splitext(fname)[1]
isnothing(informat) && (informat = detect_informat(source))

View File

@ -320,7 +320,7 @@ end
function get_cwd(doc::WeaveDoc, out_path)
# Set the output directory
if out_path === :doc
cwd = doc.path
cwd = dirname(doc.path)
elseif out_path === :pwd
cwd = pwd()
else