From c1add857f8e3733a59d8237468e1f51bd765e182 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 6 Apr 2018 16:06:11 +0200 Subject: [PATCH] rely on IJulia to install jupyter --- REQUIRE | 1 + src/Examples.jl | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/REQUIRE b/REQUIRE index 289234b..f6031fa 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,3 @@ julia 0.6 JSON +IJulia diff --git a/src/Examples.jl b/src/Examples.jl index 05af8dc..77d80ef 100644 --- a/src/Examples.jl +++ b/src/Examples.jl @@ -2,7 +2,7 @@ module Examples import Compat: replace, popfirst!, @error, @info -import JSON +import JSON, IJulia # # Some simple rules: # @@ -249,8 +249,8 @@ function notebook(inputfile, outputdir; preprocess = identity, postprocess = ide # create the notebook nb = Dict() - nb["nbformat"] = 4 - nb["nbformat_minor"] = 2 + nb["nbformat"] = IJulia.jupyter_vers.major + nb["nbformat_minor"] = IJulia.jupyter_vers.minor ## create the notebook cells chunks = parse(content) @@ -309,7 +309,7 @@ function notebook(inputfile, outputdir; preprocess = identity, postprocess = ide if execute @info "executing notebook $(outputfile)" try - run(`jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --execute $(abspath(outputfile)) --output $(filename(outputfile)).ipynb`) + run(`$(IJulia.jupyter)-nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --execute $(abspath(outputfile)) --output $(filename(outputfile)).ipynb`) catch err @error "error when executing notebook $(outputfile)" rethrow(err)