Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms:master commit in: /
Date: Sun, 01 Jan 2023 17:57:48
Message-Id: 1672177474.ab2bce21ac83e6ad6cc649ef09cd4bae334e4417.ulm@gentoo
1 commit: ab2bce21ac83e6ad6cc649ef09cd4bae334e4417
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 27 21:35:14 2022 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 27 21:44:34 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=ab2bce21
7
8 Makefile: Use guessable names for section references in HTML output
9
10 This replaces the "x1*" fragment identifiers by more predictable ones
11 with a "chapter", "section", or "appendix" prefix. This is possible
12 because our section numbers are unique.
13
14 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
15
16 Makefile | 5 +++++
17 1 file changed, 5 insertions(+)
18
19 diff --git a/Makefile b/Makefile
20 index 89fd7a2..c882534 100644
21 --- a/Makefile
22 +++ b/Makefile
23 @@ -54,6 +54,11 @@ pms.html: $(LATEXFILES) pms.bbl $(COMMITINFO)
24 @# remove redundant span elements
25 LC_ALL=C sed -Ei ':x;/<span(\s+[^>]*)?$$/{N;bx;};'\
26 ':y;s,(<span\s+[^>]*>)([^<]*)</span>\1,\1\2,;ty' $@
27 + @# guessable names for sections
28 + LC_ALL=C sed -Ei \
29 + -e 's/("#?)x1-[0-9]*00+([1-9][0-9]?")/\1chapter-\2/g' \
30 + -e 's/("#?)x1-[0-9]*00+([1-9][0-9]?(\.[0-9]+)+")/\1section-\2/g' \
31 + -e 's/("#?)x1-[0-9]*00+([A-Z](\.[0-9]+)*")/\1appendix-\2/g' $@
32
33 pms.bbl: pms.bib $(LATEXFILES) $(COMMITINFO)
34 $(aux-clean)