|
|
|
@ -97,6 +97,9 @@ Create a script file. |
|
|
|
""" |
|
|
|
""" |
|
|
|
function script(inputfile, outputdir; preprocess = identity, postprocess = identity, |
|
|
|
function script(inputfile, outputdir; preprocess = identity, postprocess = identity, |
|
|
|
name = filename(inputfile), kwargs...) |
|
|
|
name = filename(inputfile), kwargs...) |
|
|
|
|
|
|
|
# normalize paths |
|
|
|
|
|
|
|
inputfile = realpath(abspath(inputfile)) |
|
|
|
|
|
|
|
outputdir = realpath(abspath(outputdir)) |
|
|
|
@info "generating plain script file from $(inputfile)" |
|
|
|
@info "generating plain script file from $(inputfile)" |
|
|
|
# read content |
|
|
|
# read content |
|
|
|
content = read(inputfile, String) |
|
|
|
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, |
|
|
|
function markdown(inputfile, outputdir; preprocess = identity, postprocess = identity, |
|
|
|
name = filename(inputfile), |
|
|
|
name = filename(inputfile), |
|
|
|
codefence::Pair = "```@example $(name)" => "```", kwargs...) |
|
|
|
codefence::Pair = "```@example $(name)" => "```", kwargs...) |
|
|
|
|
|
|
|
# normalize paths |
|
|
|
|
|
|
|
inputfile = realpath(abspath(inputfile)) |
|
|
|
|
|
|
|
outputdir = realpath(abspath(outputdir)) |
|
|
|
@info "generating markdown page from $(inputfile)" |
|
|
|
@info "generating markdown page from $(inputfile)" |
|
|
|
# read content |
|
|
|
# read content |
|
|
|
content = read(inputfile, String) |
|
|
|
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, |
|
|
|
function notebook(inputfile, outputdir; preprocess = identity, postprocess = identity, |
|
|
|
execute::Bool=false, |
|
|
|
execute::Bool=false, |
|
|
|
name = filename(inputfile), kwargs...) |
|
|
|
name = filename(inputfile), kwargs...) |
|
|
|
|
|
|
|
# normalize paths |
|
|
|
|
|
|
|
inputfile = realpath(abspath(inputfile)) |
|
|
|
|
|
|
|
outputdir = realpath(abspath(outputdir)) |
|
|
|
@info "generating notebook from $(inputfile)" |
|
|
|
@info "generating notebook from $(inputfile)" |
|
|
|
# read content |
|
|
|
# read content |
|
|
|
content = read(inputfile, String) |
|
|
|
content = read(inputfile, String) |
|
|
|
|