summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2022-12-27 22:35:14 +0100
committerUlrich Müller <ulm@gentoo.org>2022-12-27 22:44:34 +0100
commitab2bce21ac83e6ad6cc649ef09cd4bae334e4417 (patch)
tree507996e7cb113fc486ea170110189bafd3b35839
parentRevert "Appendix: Do not number sections." (diff)
downloadpms-ab2bce21ac83e6ad6cc649ef09cd4bae334e4417.tar.gz
pms-ab2bce21ac83e6ad6cc649ef09cd4bae334e4417.tar.bz2
pms-ab2bce21ac83e6ad6cc649ef09cd4bae334e4417.zip
Makefile: Use guessable names for section references in HTML output
This replaces the "x1*" fragment identifiers by more predictable ones with a "chapter", "section", or "appendix" prefix. This is possible because our section numbers are unique. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 89fd7a2..c882534 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,11 @@ pms.html: $(LATEXFILES) pms.bbl $(COMMITINFO)
@# remove redundant span elements
LC_ALL=C sed -Ei ':x;/<span(\s+[^>]*)?$$/{N;bx;};'\
':y;s,(<span\s+[^>]*>)([^<]*)</span>\1,\1\2,;ty' $@
+ @# guessable names for sections
+ LC_ALL=C sed -Ei \
+ -e 's/("#?)x1-[0-9]*00+([1-9][0-9]?")/\1chapter-\2/g' \
+ -e 's/("#?)x1-[0-9]*00+([1-9][0-9]?(\.[0-9]+)+")/\1section-\2/g' \
+ -e 's/("#?)x1-[0-9]*00+([A-Z](\.[0-9]+)*")/\1appendix-\2/g' $@
pms.bbl: pms.bib $(LATEXFILES) $(COMMITINFO)
$(aux-clean)