Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
COBREXA.jl
Commits
d52be508
Commit
d52be508
authored
Oct 13, 2021
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docs/make.jl
View file @
d52be508
using
Documenter
,
COBREXA
using
Literate
using
Documenter
using
Literate
,
JSON
using
COBREXA
# Note: required to deploy the doc from Gitlab CI instead of Travis
ENV
[
"TRAVIS_REPO_SLUG"
]
=
"LCSB-BioCore/COBREXA.jl"
...
...
@@ -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"
,
"index.md.template"
))
# 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"
)
end
# deploy the result
deploydocs
(
repo
=
"github.com/
$
(ENV["
TRAVIS_REPO_SLUG
"]).git"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment