Skip to content

Commit 8eb23ed

Browse files
authored
Merge pull request #843 from dschaller/easier-make-docs
inline doctstring of make targets
2 parents 131cbeb + 3df3754 commit 8eb23ed

File tree

1 file changed

+27
-52
lines changed

1 file changed

+27
-52
lines changed

docs/Makefile

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,75 +17,50 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1717
.PHONY: help
1818
help:
1919
@echo "Please use \`make <target>' where <target> is one of"
20-
@echo " html to make standalone HTML files"
21-
@echo " dirhtml to make HTML files named index.html in directories"
22-
@echo " singlehtml to make a single large HTML file"
23-
@echo " pickle to make pickle files"
24-
@echo " json to make JSON files"
25-
@echo " htmlhelp to make HTML files and a HTML help project"
26-
@echo " qthelp to make HTML files and a qthelp project"
27-
@echo " applehelp to make an Apple Help Book"
28-
@echo " devhelp to make HTML files and a Devhelp project"
29-
@echo " epub to make an epub"
30-
@echo " epub3 to make an epub3"
31-
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
32-
@echo " latexpdf to make LaTeX files and run them through pdflatex"
33-
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
34-
@echo " text to make text files"
35-
@echo " man to make manual pages"
36-
@echo " texinfo to make Texinfo files"
37-
@echo " info to make Texinfo files and run them through makeinfo"
38-
@echo " gettext to make PO message catalogs"
39-
@echo " changes to make an overview of all changed/added/deprecated items"
40-
@echo " xml to make Docutils-native XML files"
41-
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
42-
@echo " linkcheck to check all external links for integrity"
43-
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
44-
@echo " coverage to run coverage check of the documentation (if enabled)"
45-
@echo " dummy to check syntax errors of document sources"
20+
@grep -E '^\.PHONY: [a-zA-Z_-]+ .*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = "(: |##)"}; {printf "\033[36m%-30s\033[0m %s\n", $$2, $$3}'
4621

4722
.PHONY: clean
4823
clean:
4924
rm -rf $(BUILDDIR)/*
5025

51-
.PHONY: html
26+
.PHONY: html ## to make standalone HTML files
5227
html:
5328
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
5429
@echo
5530
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
5631

57-
.PHONY: dirhtml
32+
.PHONY: dirhtml ## to make HTML files named index.html in directories
5833
dirhtml:
5934
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
6035
@echo
6136
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
6237

63-
.PHONY: singlehtml
38+
.PHONY: singlehtml ## to make a single large HTML file
6439
singlehtml:
6540
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
6641
@echo
6742
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
6843

69-
.PHONY: pickle
44+
.PHONY: pickle ## to make pickle files
7045
pickle:
7146
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
7247
@echo
7348
@echo "Build finished; now you can process the pickle files."
7449

75-
.PHONY: json
50+
.PHONY: json ## to make JSON files
7651
json:
7752
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
7853
@echo
7954
@echo "Build finished; now you can process the JSON files."
8055

81-
.PHONY: htmlhelp
56+
.PHONY: htmlhelp ## to make HTML files and a HTML help project
8257
htmlhelp:
8358
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
8459
@echo
8560
@echo "Build finished; now you can run HTML Help Workshop with the" \
8661
".hhp project file in $(BUILDDIR)/htmlhelp."
8762

88-
.PHONY: qthelp
63+
.PHONY: qthelp ## to make HTML files and a qthelp project
8964
qthelp:
9065
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
9166
@echo
@@ -95,7 +70,7 @@ qthelp:
9570
@echo "To view the help file:"
9671
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Graphene.qhc"
9772

98-
.PHONY: applehelp
73+
.PHONY: applehelp ## to make an Apple Help Book
9974
applehelp:
10075
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
10176
@echo
@@ -104,7 +79,7 @@ applehelp:
10479
"~/Library/Documentation/Help or install it in your application" \
10580
"bundle."
10681

107-
.PHONY: devhelp
82+
.PHONY: devhelp ## to make HTML files and a Devhelp project
10883
devhelp:
10984
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
11085
@echo
@@ -114,111 +89,111 @@ devhelp:
11489
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Graphene"
11590
@echo "# devhelp"
11691

117-
.PHONY: epub
92+
.PHONY: epub ## to make an epub
11893
epub:
11994
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
12095
@echo
12196
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
12297

123-
.PHONY: epub3
98+
.PHONY: epub3 ## to make an epub3
12499
epub3:
125100
$(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
126101
@echo
127102
@echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
128103

129-
.PHONY: latex
104+
.PHONY: latex ## to make LaTeX files, you can set PAPER=a4 or PAPER=letter
130105
latex:
131106
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
132107
@echo
133108
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
134109
@echo "Run \`make' in that directory to run these through (pdf)latex" \
135110
"(use \`make latexpdf' here to do that automatically)."
136111

137-
.PHONY: latexpdf
112+
.PHONY: latexpdf ## to make LaTeX files and run them through pdflatex
138113
latexpdf:
139114
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140115
@echo "Running LaTeX files through pdflatex..."
141116
$(MAKE) -C $(BUILDDIR)/latex all-pdf
142117
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143118

144-
.PHONY: latexpdfja
119+
.PHONY: latexpdfja ## to make LaTeX files and run them through platex/dvipdfmx
145120
latexpdfja:
146121
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
147122
@echo "Running LaTeX files through platex and dvipdfmx..."
148123
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
149124
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
150125

151-
.PHONY: text
126+
.PHONY: text ## to make text files
152127
text:
153128
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
154129
@echo
155130
@echo "Build finished. The text files are in $(BUILDDIR)/text."
156131

157-
.PHONY: man
132+
.PHONY: man ## to make manual pages
158133
man:
159134
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
160135
@echo
161136
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
162137

163-
.PHONY: texinfo
138+
.PHONY: texinfo ## to make Texinfo files
164139
texinfo:
165140
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
166141
@echo
167142
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
168143
@echo "Run \`make' in that directory to run these through makeinfo" \
169144
"(use \`make info' here to do that automatically)."
170145

171-
.PHONY: info
146+
.PHONY: info ## to make Texinfo files and run them through makeinfo
172147
info:
173148
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
174149
@echo "Running Texinfo files through makeinfo..."
175150
make -C $(BUILDDIR)/texinfo info
176151
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
177152

178-
.PHONY: gettext
153+
.PHONY: gettext ## to make PO message catalogs
179154
gettext:
180155
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
181156
@echo
182157
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
183158

184-
.PHONY: changes
159+
.PHONY: changes ## to make an overview of all changed/added/deprecated items
185160
changes:
186161
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
187162
@echo
188163
@echo "The overview file is in $(BUILDDIR)/changes."
189164

190-
.PHONY: linkcheck
165+
.PHONY: linkcheck ## to check all external links for integrity
191166
linkcheck:
192167
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
193168
@echo
194169
@echo "Link check complete; look for any errors in the above output " \
195170
"or in $(BUILDDIR)/linkcheck/output.txt."
196171

197-
.PHONY: doctest
172+
.PHONY: doctest ## to run all doctests embedded in the documentation (if enabled)
198173
doctest:
199174
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
200175
@echo "Testing of doctests in the sources finished, look at the " \
201176
"results in $(BUILDDIR)/doctest/output.txt."
202177

203-
.PHONY: coverage
178+
.PHONY: coverage ## to run coverage check of the documentation (if enabled)
204179
coverage:
205180
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
206181
@echo "Testing of coverage in the sources finished, look at the " \
207182
"results in $(BUILDDIR)/coverage/python.txt."
208183

209-
.PHONY: xml
184+
.PHONY: xml ## to make Docutils-native XML files
210185
xml:
211186
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
212187
@echo
213188
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
214189

215-
.PHONY: pseudoxml
190+
.PHONY: pseudoxml ## to make pseudoxml-XML files for display purposes
216191
pseudoxml:
217192
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
218193
@echo
219194
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
220195

221-
.PHONY: dummy
196+
.PHONY: dummy ## to check syntax errors of document sources
222197
dummy:
223198
$(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
224199
@echo

0 commit comments

Comments
 (0)