@@ -27,143 +27,154 @@ allsphinxopts := "-d " + builddir + "/doctrees " + sphinxopts + " ."
2727default :
2828 @ just --list
2929
30- # ============================================================================
31- # Build targets
32- # ============================================================================
33-
3430# Build HTML documentation
31+ [group : ' build' ]
3532html :
3633 {{ sphinxbuild }} -b html {{ allsphinxopts }} {{ builddir }} / html
3734 @ echo " "
3835 @ echo " Build finished. The HTML pages are in {{ builddir }} /html."
3936
40- # Clean build directory
41- clean :
42- rm -rf {{ builddir }} / *
43-
4437# Build directory HTML files
38+ [group : ' build' ]
4539dirhtml :
4640 {{ sphinxbuild }} -b dirhtml {{ allsphinxopts }} {{ builddir }} / dirhtml
4741 @ echo " "
4842 @ echo " Build finished. The HTML pages are in {{ builddir }} /dirhtml."
4943
5044# Build single HTML file
45+ [group : ' build' ]
5146singlehtml :
5247 {{ sphinxbuild }} -b singlehtml {{ allsphinxopts }} {{ builddir }} / singlehtml
5348 @ echo " "
5449 @ echo " Build finished. The HTML page is in {{ builddir }} /singlehtml."
5550
5651# Build EPUB
52+ [group : ' build' ]
5753epub :
5854 {{ sphinxbuild }} -b epub {{ allsphinxopts }} {{ builddir }} / epub
5955 @ echo " "
6056 @ echo " Build finished. The epub file is in {{ builddir }} /epub."
6157
6258# Build LaTeX files
59+ [group : ' build' ]
6360latex :
6461 {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }} / latex
6562 @ echo " "
6663 @ echo " Build finished; the LaTeX files are in {{ builddir }} /latex."
6764
6865# Build PDF via LaTeX
66+ [group : ' build' ]
6967latexpdf :
7068 {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }} / latex
7169 @ echo " Running LaTeX files through pdflatex..."
7270 make -C {{ builddir }} / latex all-pdf
7371 @ echo " pdflatex finished; the PDF files are in {{ builddir }} /latex."
7472
7573# Build plain text files
74+ [group : ' build' ]
7675text :
7776 {{ sphinxbuild }} -b text {{ allsphinxopts }} {{ builddir }} / text
7877 @ echo " "
7978 @ echo " Build finished. The text files are in {{ builddir }} /text."
8079
8180# Build man pages
81+ [group : ' build' ]
8282man :
8383 {{ sphinxbuild }} -b man {{ allsphinxopts }} {{ builddir }} / man
8484 @ echo " "
8585 @ echo " Build finished. The manual pages are in {{ builddir }} /man."
8686
8787# Build JSON output
88+ [group : ' build' ]
8889json :
8990 {{ sphinxbuild }} -b json {{ allsphinxopts }} {{ builddir }} / json
9091 @ echo " "
9192 @ echo " Build finished; now you can process the JSON files."
9293
94+ # Clean build directory
95+ [group : ' misc' ]
96+ [confirm ]
97+ clean :
98+ rm -rf {{ builddir }} / *
99+
93100# Build HTML help files
101+ [group : ' misc' ]
94102htmlhelp :
95103 {{ sphinxbuild }} -b htmlhelp {{ allsphinxopts }} {{ builddir }} / htmlhelp
96104 @ echo " "
97105 @ echo " Build finished; now you can run HTML Help Workshop with the .hhp project file in {{ builddir }} /htmlhelp."
98106
99107# Build Qt help files
108+ [group : ' misc' ]
100109qthelp :
101110 {{ sphinxbuild }} -b qthelp {{ allsphinxopts }} {{ builddir }} / qthelp
102111 @ echo " "
103112 @ echo " Build finished; now you can run 'qcollectiongenerator' with the .qhcp project file in {{ builddir }} /qthelp."
104113
105114# Build Devhelp files
115+ [group : ' misc' ]
106116devhelp :
107117 {{ sphinxbuild }} -b devhelp {{ allsphinxopts }} {{ builddir }} / devhelp
108118 @ echo " "
109119 @ echo " Build finished."
110120
111121# Build Texinfo files
122+ [group : ' misc' ]
112123texinfo :
113124 {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }} / texinfo
114125 @ echo " "
115126 @ echo " Build finished. The Texinfo files are in {{ builddir }} /texinfo."
116127
117128# Build Info files from Texinfo
129+ [group : ' misc' ]
118130info :
119131 {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }} / texinfo
120132 @ echo " Running Texinfo files through makeinfo..."
121133 make -C {{ builddir }} / texinfo info
122134 @ echo " makeinfo finished; the Info files are in {{ builddir }} /texinfo."
123135
124136# Build gettext catalogs
137+ [group : ' misc' ]
125138gettext :
126139 {{ sphinxbuild }} -b gettext {{ sphinxopts }} . {{ builddir }} / locale
127140 @ echo " "
128141 @ echo " Build finished. The message catalogs are in {{ builddir }} /locale."
129142
130- # ============================================================================
131- # Validation
132- # ============================================================================
133-
134143# Check all external links
144+ [group : ' validate' ]
135145linkcheck :
136146 {{ sphinxbuild }} -b linkcheck {{ allsphinxopts }} {{ builddir }} / linkcheck
137147 @ echo " "
138148 @ echo " Link check complete; look for any errors in the above output or in {{ builddir }} /linkcheck/output.txt."
139149
140150# Run doctests embedded in documentation
151+ [group : ' validate' ]
141152doctest :
142153 {{ sphinxbuild }} -b doctest {{ allsphinxopts }} {{ builddir }} / doctest
143154 @ echo " Testing of doctests in the sources finished, look at the results in {{ builddir }} /doctest/output.txt."
144155
145156# Check build from scratch
157+ [group : ' validate' ]
146158checkbuild :
147159 rm -rf {{ builddir }}
148160 {{ sphinxbuild }} -n -q ./ {{ builddir }}
149161
150162# Build redirects configuration
163+ [group : ' misc' ]
151164redirects :
152165 {{ sphinxbuild }} -b rediraffewritediff {{ allsphinxopts }} {{ builddir }} / redirect
153166 @ echo " "
154167 @ echo " Build finished. The redirects are in rediraffe_redirects."
155168
156169# Show changes overview
170+ [group : ' misc' ]
157171changes :
158172 {{ sphinxbuild }} -b changes {{ allsphinxopts }} {{ builddir }} / changes
159173 @ echo " "
160174 @ echo " The overview file is in {{ builddir }} /changes."
161175
162- # ============================================================================
163- # Development
164- # ============================================================================
165-
166176# Watch files and rebuild on change
177+ [group : ' dev' ]
167178watch :
168179 #!/usr/bin/env bash
169180 set -euo pipefail
@@ -174,6 +185,7 @@ watch:
174185 fi
175186
176187# Serve documentation via Python http.server
188+ [group : ' dev' ]
177189serve :
178190 @ echo ' ================================================='
179191 @ echo ' '
@@ -183,16 +195,19 @@ serve:
183195 python -m http.server {{ http_port }} --directory {{ builddir }} / html
184196
185197# Watch and serve simultaneously
198+ [group : ' dev' ]
186199dev :
187200 #!/usr/bin/env bash
188201 set -euo pipefail
189202 just watch &
190203 just serve
191204
192205# Start sphinx-autobuild server
206+ [group : ' dev' ]
193207start :
194208 {{ sphinx_autobuild }} " {{ sourcedir }} " " {{ builddir }} " {{ sphinxopts }} --port {{ http_port }}
195209
196210# Design mode: watch static files and disable incremental builds
211+ [group : ' dev' ]
197212design :
198213 {{ sphinx_autobuild }} " {{ sourcedir }} " " {{ builddir }} " {{ sphinxopts }} --port {{ http_port }} --watch " ." -a
0 commit comments