Commit d52be508 authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

rewrite julia version in notebooks to one compatible with binder

Fixes #388
parent 0560bd18
Pipeline #48270 passed with stages
in 9 minutes and 32 seconds
using Documenter, COBREXA
using Literate
using Documenter
using Literate, JSON
# Note: required to deploy the doc from Gitlab CI instead of Travis
......@@ -100,7 +101,8 @@ replace_in_doc(
# dumps that contain the dumped environment strings, which in turn contain
# github auth tokens. These certainly need to be avoided.
notebooks_names = [n[begin:end-3] for n in notebooks_basenames]
notebooks_allowed_files = vcat("index.html", notebooks_names .* ".ipynb")
ipynb_names = notebooks_names .* ".ipynb"
notebooks_allowed_files = vcat("index.html", ipynb_names)
@info "allowed files:" notebooks_allowed_files
for (root, dirs, files) in walkdir(joinpath(@__DIR__, "build", "notebooks"))
for f in files
......@@ -114,6 +116,16 @@ end
# also remove the index template
rm(joinpath(@__DIR__, "build", ""))
# Binder does not support Julia 1.6 kernels yet, so let's force the Julia 1.5
# kernel for now.
for ipynb in joinpath.(@__DIR__, "build", "notebooks", ipynb_names)
@info "changing julia version to 1.5 in `$ipynb'"
js = JSON.parsefile(ipynb)
js["metadata"]["kernelspec"]["name"] = "julia-1.5"
js["metadata"]["kernelspec"]["display_name"] = "Julia 1.5"
open(f -> JSON.print(f, js), ipynb, "w")
# deploy the result
repo = "$(ENV["TRAVIS_REPO_SLUG"]).git",
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment