2
2
#
3
3
#
4
4
5
+ if " --help" ∈ ARGS
6
+ println (
7
+ """
8
+ docs/make.jl
9
+
10
+ Render the `Manopt.jl` documenation with optinal arguments
11
+
12
+ Arguments
13
+ * `--exclude-docs` - exclude the tutorials from the menu of Documenter,
14
+ this can be used if you do not have Quarto installed to still be able to render the docs
15
+ locally on this machine. This option should not be set on CI.
16
+ * `--help` - print this help and exit without rendering the documentation
17
+ * `--quarto` – run the Quarto notebooks from the `tutorials/` folder before generating the documentation
18
+ this has to be run locally at least once for the `tutorials/*.md` files to exist that are included in
19
+ the documentation (see `--exclude-tutorials`) for the alternative.
20
+ If they are generated ones they are cached accordingly.
21
+ Then you can spare time in the rendering by not passing this argument.
22
+ """ ,
23
+ )
24
+ exit (0 )
25
+ end
26
+
5
27
#
6
28
# (a) if docs is not the current active environment, switch to it
7
29
# (from https://github.com/JuliaIO/HDF5.jl/pull/1020/)
@@ -29,6 +51,17 @@ if "--quarto" ∈ ARGS
29
51
end
30
52
end
31
53
54
+ tutorials_in_menu = true
55
+ if " --exclude-tutorials" ∈ ARGS
56
+ @warn """
57
+ You are excluding the tutorials from the Menu,
58
+ which might be done if you can not render them locally.
59
+
60
+ Remember that this should never be done on CI for the full documentation.
61
+ """
62
+ tutorials_in_menu = false
63
+ end
64
+
32
65
# (c) load necessary packages for the docs
33
66
using Documenter
34
67
using DocumenterCitations
@@ -38,26 +71,42 @@ using LineSearches, LRUCache, Manopt, Manifolds, Plots
38
71
generated_path = joinpath (@__DIR__ , " src" )
39
72
base_url = " https://github.com/JuliaManifolds/Manopt.jl/blob/master/"
40
73
isdir (generated_path) || mkdir (generated_path)
41
- open (joinpath (generated_path, " contributing.md" ), " w" ) do io
42
- # Point to source license file
43
- println (
44
- io,
45
- """
46
- ```@meta
47
- EditURL = "$(base_url) CONTRIBUTING.md"
48
- ```
49
- """ ,
50
- )
51
- # Write the contents out below the meta block
52
- for line in eachline (joinpath (dirname (@__DIR__ ), " CONTRIBUTING.md" ))
53
- println (io, line)
74
+ for (md_file, doc_file) in
75
+ [(" CONTRIBUTING.md" , " contributing.md" ), (" Changelog.md" , " changelog.md" )]
76
+ open (joinpath (generated_path, doc_file), " w" ) do io
77
+ # Point to source license file
78
+ println (
79
+ io,
80
+ """
81
+ ```@meta
82
+ EditURL = "$(base_url)$(md_file) "
83
+ ```
84
+ """ ,
85
+ )
86
+ # Write the contents out below the meta block
87
+ for line in eachline (joinpath (dirname (@__DIR__ ), md_file))
88
+ println (io, line)
89
+ end
54
90
end
55
91
end
56
92
93
+ # # Build titorials menu
94
+ tutorials_menu =
95
+ " How to..." => [
96
+ " Get started: Optimize!" => " tutorials/Optimize!.md" ,
97
+ " Speedup using Inplace computations" => " tutorials/InplaceGradient.md" ,
98
+ " Use Automatic Differentiation" => " tutorials/AutomaticDifferentiation.md" ,
99
+ " Define Objectives in the Embedding" => " tutorials/EmbeddingObjectives.md" ,
100
+ " Count and use a Cache" => " tutorials/CountAndCache.md" ,
101
+ " Print Debug Output" => " tutorials/HowToDebug.md" ,
102
+ " Record values" => " tutorials/HowToRecord.md" ,
103
+ " Implement a Solver" => " tutorials/ImplementASolver.md" ,
104
+ " Do Constrained Optimization" => " tutorials/ConstrainedOptimization.md" ,
105
+ " Do Geodesic Regression" => " tutorials/GeodesicRegression.md" ,
106
+ ]
57
107
# (e) ...finally! make docs
58
108
bib = CitationBibliography (joinpath (@__DIR__ , " src" , " references.bib" ); style= :alpha )
59
- makedocs (
60
- bib;
109
+ makedocs (;
61
110
format= Documenter. HTML (;
62
111
mathengine= MathJax3 (), prettyurls= get (ENV , " CI" , nothing ) == " true"
63
112
),
@@ -86,36 +135,10 @@ makedocs(
86
135
],
87
136
authors= " Ronny Bergmann and contributors." ,
88
137
sitename= " Manopt.jl" ,
89
- strict= [
90
- :doctest ,
91
- :linkcheck ,
92
- :parse_error ,
93
- :example_block ,
94
- :autodocs_block ,
95
- :cross_references ,
96
- :docs_block ,
97
- :eval_block ,
98
- :example_block ,
99
- :footnote ,
100
- :meta_block ,
101
- :missing_docs ,
102
- :setup_block ,
103
- ],
104
138
pages= [
105
139
" Home" => " index.md" ,
106
140
" About" => " about.md" ,
107
- " How to..." => [
108
- " Get started: Optimize!" => " tutorials/Optimize!.md" ,
109
- " Speedup using Inplace computations" => " tutorials/InplaceGradient.md" ,
110
- " Use Automatic Differentiation" => " tutorials/AutomaticDifferentiation.md" ,
111
- " Define Objectives in the Embedding" => " tutorials/EmbeddingObjectives.md" ,
112
- " Count and use a Cache" => " tutorials/CountAndCache.md" ,
113
- " Print Debug Output" => " tutorials/HowToDebug.md" ,
114
- " Record values" => " tutorials/HowToRecord.md" ,
115
- " Implement a Solver" => " tutorials/ImplementASolver.md" ,
116
- " Do Constrained Optimization" => " tutorials/ConstrainedOptimization.md" ,
117
- " Do Geodesic Regression" => " tutorials/GeodesicRegression.md" ,
118
- ],
141
+ (tutorials_in_menu ? [tutorials_menu] : []). .. ,
119
142
" Solvers" => [
120
143
" Introduction" => " solvers/index.md" ,
121
144
" Adaptive Regularization with Cubics" => " solvers/adaptive-regularization-with-cubics.md" ,
@@ -168,8 +191,10 @@ makedocs(
168
191
" Contributing to Manopt.jl" => " contributing.md" ,
169
192
" Extensions" => " extensions.md" ,
170
193
" Notation" => " notation.md" ,
194
+ " Changelog" => " changelog.md" ,
171
195
" References" => " references.md" ,
172
196
],
197
+ plugins= [bib],
173
198
)
174
199
deploydocs (; repo= " github.com/JuliaManifolds/Manopt.jl" , push_preview= true )
175
200
# back to main env
0 commit comments