public inbox for gentoo-pms@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-pms@lists.gentoo.org
Cc: "Ulrich Müller" <ulm@gentoo.org>
Subject: [gentoo-pms] [PATCH 3/3] Makefile: Use guessable names for section references in HTML output
Date: Tue, 27 Dec 2022 22:57:46 +0100	[thread overview]
Message-ID: <20221227215746.2622-4-ulm@gentoo.org> (raw)
In-Reply-To: <20221227215746.2622-1-ulm@gentoo.org>

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>
---
 Makefile | 5 +++++
 1 file changed, 5 insertions(+)

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)
-- 
2.39.0



      parent reply	other threads:[~2022-12-27 21:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 21:57 [gentoo-pms] [PATCH 0/3] Guessable section labels in HTML output Ulrich Müller
2022-12-27 21:57 ` [gentoo-pms] [PATCH 1/3] Revert "Appendix: Include EAPI differences sections in table of contents." Ulrich Müller
2022-12-27 21:57 ` [gentoo-pms] [PATCH 2/3] Revert "Appendix: Do not number sections." Ulrich Müller
2022-12-27 21:57 ` Ulrich Müller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221227215746.2622-4-ulm@gentoo.org \
    --to=ulm@gentoo.org \
    --cc=gentoo-pms@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox