forked from dionysos-dev/Dionysos.jl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmake.jl
55 lines (49 loc) · 1.77 KB
/
make.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Dionysos
using Documenter, Literate
const EXAMPLES_DIR = joinpath(@__DIR__, "src", "examples")
const REFERENCE_DIR = joinpath(@__DIR__, "src", "reference")
const OUTPUT_DIR = joinpath(@__DIR__, "src/generated")
const EXAMPLES = readdir(EXAMPLES_DIR)
const REFERENCE = readdir(REFERENCE_DIR)
for example in EXAMPLES
example_filepath = joinpath(EXAMPLES_DIR, example)
Literate.markdown(example_filepath, OUTPUT_DIR)
Literate.notebook(example_filepath, OUTPUT_DIR)
Literate.script(example_filepath, OUTPUT_DIR)
end
const _PAGES = [
"Index" => "index.md",
"Examples" => map(EXAMPLES) do jl_file
# Need `string` as Documenter fails if `name` is a `SubString{String}`.
name = string(split(jl_file, ".")[1])
return name => "generated/$name.md"
end,
"API Reference" => map(REFERENCE) do jl_file
# Need `string` as Documenter fails if `name` is a `SubString{String}`.
name = string(split(jl_file, ".")[1])
return name => "reference/$name.md"
end,
"Developer Docs" => [
"Set up" => "developers/setup.md",
"Git" => "developers/git.md",
],
]
makedocs(
sitename = "Dionysos",
# See https://github.com/JuliaDocs/Documenter.jl/issues/868
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/extra_styles.css"]
),
# See https://github.com/jump-dev/JuMP.jl/issues/1576
strict = true,
pages = _PAGES,
# The following ensures that we only include the docstrings from
# this module for functions defined in Base that we overwrite.
# It also errors in case we don't include a docstring in the docs
modules = [Dionysos],
)
deploydocs(
repo = "github.com/dionysos-dev/Dionysos.jl.git",
push_preview = true,
)