|
| 1 | +# Adapted from JUMP. The license is MPL version 2.0. |
| 2 | + |
1 | 3 | using Groebner
|
2 | 4 | using Documenter
|
3 | 5 |
|
4 |
| -makedocs( |
5 |
| - modules = [Groebner], |
6 |
| - sitename = "Groebner.jl", |
7 |
| - doctest = true, |
| 6 | +# Setup |
| 7 | + |
| 8 | +const _IS_GITHUB_ACTIONS = get(ENV, "GITHUB_ACTIONS", "false") == "true" |
| 9 | + |
| 10 | +latex_platform = _IS_GITHUB_ACTIONS ? "docker" : "native" |
| 11 | + |
| 12 | +# Documentation structure |
| 13 | + |
| 14 | +PAGES = [ |
| 15 | + "Home" => "index.md", |
| 16 | + "Examples" => "examples.md", |
| 17 | + "Interface" => "interface.md" |
| 18 | +] |
| 19 | + |
| 20 | +# Build the HTML documentation |
| 21 | + |
| 22 | +# Needed to make Documenter think that there is a PDF in the right place when |
| 23 | +# link checking. Inn production we replace this by running the LaTeX build. |
| 24 | +write(joinpath(@__DIR__, "src", "Groebner.jl.pdf"), "") |
| 25 | + |
| 26 | +@time Documenter.makedocs( |
| 27 | + modules = [Groebner], |
| 28 | + sitename = "Groebner.jl", |
| 29 | + doctest = true, |
8 | 30 | linkcheck = true,
|
9 | 31 | checkdocs = :exports,
|
10 |
| - warnonly=true, |
11 |
| - pages = [ |
12 |
| - "Home" => "index.md", |
13 |
| - "Examples" => "examples.md", |
14 |
| - "Interface" => "interface.md", |
15 |
| - ], |
| 32 | + warnonly = true, |
| 33 | + pages = PAGES |
| 34 | +) |
| 35 | + |
| 36 | +# Build the PDF documentation |
| 37 | + |
| 38 | +@time Documenter.makedocs( |
| 39 | + sitename = "Groebner.jl", |
| 40 | + authors = "The Groebner.jl developers and contributors", |
| 41 | + format = Documenter.LaTeX(; platform=latex_platform), |
| 42 | + build = "latex_build", |
| 43 | + pages = PAGES, |
| 44 | + debug = true |
| 45 | +) |
| 46 | +cp( |
| 47 | + joinpath(@__DIR__, "latex_build", "Groebner.jl.pdf"), |
| 48 | + joinpath(@__DIR__, "build", "Groebner.jl.pdf"); |
| 49 | + force=true |
16 | 50 | )
|
17 | 51 |
|
| 52 | +# Deploy build/ |
18 | 53 |
|
19 | 54 | deploydocs(
|
20 |
| - repo = "github.com/sumiya11/Groebner.jl.git" |
| 55 | + repo="github.com/sumiya11/Groebner.jl.git" |
21 | 56 | )
|
0 commit comments