Skip to content
Snippets Groups Projects
Commit fcf7a4a6 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Automate pre/postprocessing when building doc

parent 7cbd6013
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,12 @@ clean: ...@@ -50,8 +50,12 @@ clean:
.PHONY: html .PHONY: html
html: html:
@echo "Preprocessing..."
@python3 -c "import process; process.preprocess()"
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo @echo
@echo "Postprocessing..."
@python3 -c "import process; process.postprocess()"
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html." @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml .PHONY: dirhtml
......
...@@ -17,7 +17,7 @@ def preprocess(): ...@@ -17,7 +17,7 @@ def preprocess():
n_files = len(files) n_files = len(files)
for n, file_name in enumerate(files): for n, file_name in enumerate(files):
print("Preprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files)) # print("Preprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
try: try:
fh, abs_path = mkstemp() fh, abs_path = mkstemp()
with open(code_dir + "/" + file_name, 'r') as f: with open(code_dir + "/" + file_name, 'r') as f:
...@@ -52,7 +52,7 @@ def postprocess(): ...@@ -52,7 +52,7 @@ def postprocess():
n_files = len(files) n_files = len(files)
for n, file_name in enumerate(files): for n, file_name in enumerate(files):
print("Postprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files)) # print("Postprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
try: try:
fh, abs_path = mkstemp() fh, abs_path = mkstemp()
with open(code_dir + "/" + file_name, 'r') as f: with open(code_dir + "/" + file_name, 'r') as f:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment