Unverified Commit 8832e1df authored by Miroslav Kratochvil's avatar Miroslav Kratochvil
Browse files

comb down the literal notebook generation

I hope this will work at least for local docs build (see no reason not to).

Links might deserve some checking.
parent 2326989b
...@@ -29,7 +29,6 @@ temp.* ...@@ -29,7 +29,6 @@ temp.*
# Ignore jupyter notebook stuff # Ignore jupyter notebook stuff
.ipynb_checkpoints .ipynb_checkpoints
# add tutorials specififcs # add generated tutorial specifics
docs/src/generated/ docs/src/notebooks/*.md
*.ipynb docs/src/notebooks/*.ipynb
...@@ -4,22 +4,25 @@ using Literate ...@@ -4,22 +4,25 @@ using Literate
ENV["TRAVIS_REPO_SLUG"] = "LCSB-BioCore/COBREXA.jl" ENV["TRAVIS_REPO_SLUG"] = "LCSB-BioCore/COBREXA.jl"
# generate notebooks # generate notebooks
EXAMPLE = joinpath(@__DIR__, "src/notebooks", "example.jl") notebooks_path=joinpath(@__DIR__, "src", "notebooks-src")
OUTPUT = joinpath(@__DIR__, "src/tutorials") notebooks = joinpath.(notebooks_path, readdir(notebooks_path))
notebooks_outdir = joinpath(@__DIR__, "src", "notebooks")
folder = "stable" folder = "stable"
## only temporary - will be removed once public ## only temporary - will be removed once public
branch = "gh-pages" branch = "gh-pages"
Literate.markdown( for notebook in notebooks
EXAMPLE, Literate.markdown(
OUTPUT; notebook,
repo_root_url = "https://github.com/$(ENV["TRAVIS_REPO_SLUG"])/blob/master", notebooks_outdir;
nbviewer_root_url = "https://nbviewer.jupyter.org/github/$(ENV["TRAVIS_REPO_SLUG"])/blob/gh-pages/$(folder)", repo_root_url = "https://github.com/$(ENV["TRAVIS_REPO_SLUG"])/blob/master",
binder_root_url = "https://mybinder.org/v2/gh/$(ENV["TRAVIS_REPO_SLUG"])/$(branch)?filepath=$(folder)", nbviewer_root_url = "https://nbviewer.jupyter.org/github/$(ENV["TRAVIS_REPO_SLUG"])/blob/gh-pages/$(folder)",
) binder_root_url = "https://mybinder.org/v2/gh/$(ENV["TRAVIS_REPO_SLUG"])/$(branch)?filepath=$(folder)",
Literate.notebook(EXAMPLE, OUTPUT) )
Literate.notebook(notebook, notebooks_outdir)
end
makedocs( makedocs(
...@@ -37,6 +40,7 @@ makedocs( ...@@ -37,6 +40,7 @@ makedocs(
pages = [ pages = [
"Home" => "index.md", "Home" => "index.md",
"Tutorials" => "tutorials.md", "Tutorials" => "tutorials.md",
"Examples and notebooks" => "notebooks.md",
"Function reference" => "functions.md", "Function reference" => "functions.md",
"How to contribute" => "howToContribute.md", "How to contribute" => "howToContribute.md",
], ],
......
...@@ -70,8 +70,19 @@ Dict{String,Float64} with 95 entries: ...@@ -70,8 +70,19 @@ Dict{String,Float64} with 95 entries:
## Tutorials ## Tutorials
Detailed tutorial contents is [available here](tutorials.md).
```@contents
Pages = joinpath.("tutorials", readdir("tutorials"))
Depth = 1
```
## Example notebooks and workflows
Detailed notebook content is [available here](notebooks.md).
```@contents ```@contents
Pages = readdir("tutorials") Pages = joinpath.("notebooks", readdir("notebooks"))
Depth = 1 Depth = 1
``` ```
...@@ -83,8 +94,4 @@ Pages = ["functions.md"] ...@@ -83,8 +94,4 @@ Pages = ["functions.md"]
## Contribution guide ## Contribution guide
If you want to contribute, please read these guidelines first: If you want to contribute, please read [the contribution guidelines and hints](howToContribute.md).
```@contents
Pages = ["howToContribute.md"]
```
# COBREXA Tutorials # COBREXA Tutorials
```@contents
Pages = joinpath.("tutorials", readdir("tutorials"))
Depth = 2
```
# Loading and converting models # Loading and converting models
This is a test.
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