diff options
author | Ulrich Müller <ulm@gentoo.org> | 2022-12-27 22:35:14 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2022-12-27 22:44:34 +0100 |
commit | ab2bce21ac83e6ad6cc649ef09cd4bae334e4417 (patch) | |
tree | 507996e7cb113fc486ea170110189bafd3b35839 | |
parent | Revert "Appendix: Do not number sections." (diff) | |
download | pms-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-- | Makefile | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |