make.jl 1.86 KB
Newer Older
Sylvain Arreckx's avatar
Sylvain Arreckx committed
1
using Documenter, COBREXA
2
3
4
5
6
using Literate

ENV["TRAVIS_REPO_SLUG"] = "LCSB-BioCore/COBREXA.jl"

# generate notebooks
Miroslav Kratochvil's avatar
format    
Miroslav Kratochvil committed
7
notebooks_path = joinpath(@__DIR__, "src", "notebooks-src")
Miroslav Kratochvil's avatar
Miroslav Kratochvil committed
8
9
notebooks =
    joinpath.(notebooks_path, filter(x -> endswith(x, ".jl"), readdir(notebooks_path)))
10
notebooks_outdir = joinpath(@__DIR__, "src", "notebooks")
11
12
13
14
15
16

folder = "stable"

## only temporary - will be removed once public
branch = "gh-pages"

17
18
19
20
21
22
23
24
25
26
for notebook in notebooks
    Literate.markdown(
        notebook,
        notebooks_outdir;
        repo_root_url = "https://github.com/$(ENV["TRAVIS_REPO_SLUG"])/blob/master",
        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(notebook, notebooks_outdir)
end
27

St. Elmo's avatar
St. Elmo committed
28
29
# generate index by cutting example from readme
include(joinpath(@__DIR__, "src", "process_readme.jl"))
cylon-x's avatar
cylon-x committed
30
31
32
33
34
35
Literate.markdown(
    joinpath(@__DIR__, "src", "index.jl"),
    joinpath(@__DIR__, "src");
    preprocess = from_readme,
    documenter = false,
)
Sylvain Arreckx's avatar
Sylvain Arreckx committed
36

St. Elmo's avatar
St. Elmo committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
makedocs(
    modules = [COBREXA],
    clean = false,
    sitename = "COBREXA.jl",
    format = Documenter.HTML(
        # Use clean URLs, unless built as a "local" build
        prettyurls = !("local" in ARGS),
        assets = ["assets/favicon.ico"],
        highlights = ["yaml"],
    ),
    authors = "The developers of COBREXA.jl",
    linkcheck = !("skiplinks" in ARGS),
    pages = [
        "Home" => "index.md",
51
        "Tutorials" => "tutorials.md",
52
        "Examples and notebooks" => "notebooks.md",
53
        "Function reference" => "functions.md",
St. Elmo's avatar
St. Elmo committed
54
55
56
        "How to contribute" => "howToContribute.md",
    ],
)
57
58
59
60
61
62


# deploydocs(
#     repo = "github.com/$(ENV["TRAVIS_REPO_SLUG"])",
#     push_preview=true,
#     deploy_config = deployconfig,
cylon-x's avatar
cylon-x committed
63
# )