Skip to content

Commit c40d359

Browse files
refactor: drop lang template mod from Makefile
Key changes: - Removed all rules that modify the template per language (versions-template-all, add-lang-to-versions-template-%). - Retained language detection for multi-language builds. - Assumes language list is passed to the template via Sphinx's conf.py or similar, not injected by Makefile. Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent ab9cfdf commit c40d359

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

user_manual/Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Makefile for Sphinx documentation
2-
#
32

43
# You can set these variables from the command line.
54
SPHINXOPTS +=
@@ -8,12 +7,14 @@ PAPER =
87
BUILDDIR = _build
98

109
# Internal variables.
11-
PAPEROPT_a4 = -D latex_paper_size=a4
12-
PAPEROPT_letter = -D latex_paper_size=letter
13-
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
10+
PAPEROPT_a4 = -D latex_paper_size=a4
11+
PAPEROPT_letter = -D latex_paper_size=letter
12+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
1413
# the i18n builder cannot share the environment and doctrees with the others
15-
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16-
LANGS = $(shell touch locale/en && ls locale | grep -v source && rm locale/en) # this trick to add en in the list of langs
14+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
15+
16+
# Dynamically build the list of language codes (including 'en')
17+
LANGS = $(shell touch locale/en && ls locale | grep -v source && rm locale/en)
1718

1819
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
1920

@@ -48,12 +49,7 @@ clean:
4849

4950
html:
5051
../build/change_file_extension.sh
51-
make versions-template-all html-all merge-folders
52-
53-
versions-template-all: $(foreach lang, $(LANGS), add-lang-to-versions-template-$(lang))
54-
55-
add-lang-to-versions-template-%:
56-
sed -i '/Here go the languages/i {% set available_languages = available_languages + ["$*"] %}' ./_templates/versions.html
52+
make html-all merge-folders
5753

5854
html-all: $(foreach lang, $(LANGS), html-allow-warnings-lang-$(lang))
5955

@@ -104,7 +100,7 @@ htmlhelp:
104100
qthelp:
105101
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
106102
@echo
107-
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
103+
@echo "Build finished; now you can run \"qcollectiongenerator\" with the" \
108104
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
109105
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/OwncloudDocumentation.qhcp"
110106
@echo "To view the help file:"

0 commit comments

Comments
 (0)