From cc1e081602f18de5386388215cc0a79c242af56b Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Mon, 9 Apr 2018 13:42:59 +0200 Subject: [PATCH] normalize paths --- src/Examples.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Examples.jl b/src/Examples.jl index 9c147b4..e30de1d 100644 --- a/src/Examples.jl +++ b/src/Examples.jl @@ -97,6 +97,9 @@ Create a script file. """ function script(inputfile, outputdir; preprocess = identity, postprocess = identity, name = filename(inputfile), kwargs...) + # normalize paths + inputfile = realpath(abspath(inputfile)) + outputdir = realpath(abspath(outputdir)) @info "generating plain script file from $(inputfile)" # read content content = read(inputfile, String) @@ -154,6 +157,9 @@ Generate a markdown file from the `input` file and write the result to the `outp function markdown(inputfile, outputdir; preprocess = identity, postprocess = identity, name = filename(inputfile), codefence::Pair = "```@example $(name)" => "```", kwargs...) + # normalize paths + inputfile = realpath(abspath(inputfile)) + outputdir = realpath(abspath(outputdir)) @info "generating markdown page from $(inputfile)" # read content content = read(inputfile, String) @@ -225,6 +231,9 @@ Generate a notebook from `inputfile` and write the result to `outputdir`. function notebook(inputfile, outputdir; preprocess = identity, postprocess = identity, execute::Bool=false, name = filename(inputfile), kwargs...) + # normalize paths + inputfile = realpath(abspath(inputfile)) + outputdir = realpath(abspath(outputdir)) @info "generating notebook from $(inputfile)" # read content content = read(inputfile, String)