Skip to content

Commit 0ae917a

Browse files
committed
build PDF documentation
1 parent 8d8ac35 commit 0ae917a

File tree

5 files changed

+56
-17
lines changed

5 files changed

+56
-17
lines changed

docs/.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__site/
2-
site/
3-
build/
1+
build
2+
latex_build
3+
Groebner.jl.pdf

docs/make.jl

+46-11
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,56 @@
1+
# Adapted from JUMP. The license is MPL version 2.0.
2+
13
using Groebner
24
using Documenter
35

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,
830
linkcheck = true,
931
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
1650
)
1751

52+
# Deploy build/
1853

1954
deploydocs(
20-
repo = "github.com/sumiya11/Groebner.jl.git"
55+
repo="github.com/sumiya11/Groebner.jl.git"
2156
)

docs/src/examples.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ For other ground fields, a possibly slower generic fallback is used. In this cas
9292

9393
For example, we can compute a Gröbner basis over a univariate rational function field over a finite field:
9494

95-
```@example generic-2
95+
```@example generic2
9696
using Groebner, AbstractAlgebra
9797
9898
R, t = GF(101)["t"]
@@ -106,7 +106,7 @@ gb = groebner(sys)
106106

107107
Many functions reuse the core implementation, so they can also be used over generic fields:
108108

109-
```@example generic-2
109+
```julia
110110
@assert isgroebner(gb)
111111
normalform(gb, x*y)
112112
```

docs/src/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Groebner.jl is a package for computing Gröbner bases written in Julia.
44

5+
!!! note
6+
7+
This documentation is also available in PDF format: [Groebner.jl.pdf](Groebner.jl.pdf).
8+
59
## Installation
610

711
To install Groebner.jl, run the following in the Julia REPL:

docs/src/interface.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
CurrentModule = Groebner
55
```
66

7-
## Exported functions
7+
## Main functions
88

99
```@docs
1010
groebner

0 commit comments

Comments
 (0)