public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/devmanual:master commit in: /, bin/
Date: Tue, 29 Oct 2024 11:19:34 +0000 (UTC)	[thread overview]
Message-ID: <1730200638.f9abc1d4273dc6dc2a61e13105f435c61a8f24ba.ulm@gentoo> (raw)

commit:     f9abc1d4273dc6dc2a61e13105f435c61a8f24ba
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 29 11:17:18 2024 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue Oct 29 11:17:18 2024 +0000
URL:        https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=f9abc1d4

bin/gen-eclass-html.sh: Add eclasses fallback for the offline version

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 Makefile               |  2 +-
 bin/gen-eclass-html.sh | 45 +++++++++++++++++++++++++++++++--------------
 2 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/Makefile b/Makefile
index 4fbbd90..a94361f 100644
--- a/Makefile
+++ b/Makefile
@@ -64,7 +64,7 @@ eclass-reference/text.xml:
 	@echo "Install app-doc/eclass-manpages and" >&2
 	@echo "run bin/gen-eclass-html.sh before calling make." >&2
 	@echo "Creating a placeholder index as fallback." >&2
-	bin/gen-eclass-html.sh -n
+	OFFLINE="$(OFFLINE)" bin/gen-eclass-html.sh -n
 
 appendices/todo-list/index.html: $(XMLS)
 

diff --git a/bin/gen-eclass-html.sh b/bin/gen-eclass-html.sh
index b17fbc5..9dd6a56 100755
--- a/bin/gen-eclass-html.sh
+++ b/bin/gen-eclass-html.sh
@@ -180,31 +180,48 @@ Note that most eclasses have an accompanying manual page. These man pages can be
 installed by emerging <c>app-doc/eclass-manpages</c>.
 </p>
 
-</body>
-
-<section>
-<title>Contents</title>
-<body>
 EOF
 
-if [[ -n ${NOMAN} ]]; then
+if [[ -z ${NOMAN} ]]; then
+	cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
+	</body>
+
+	<section>
+	<title>Contents</title>
+	<body>
+
+	<ul class="list-group">
+	EOF
+	for i in $(find "${OUTPUTDIR}" -maxdepth 1 -mindepth 1 -type d | sort); do
+		echo "<li><uri link=\"$(basename $i)/index.html\">$(basename $i)</uri></li>" \
+			>> "${OUTPUTDIR}"/text.xml || exit 1
+	done
+	cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
+	</ul>
+	</body>
+	</section>
+	EOF
+elif [[ ${OFFLINE} -ne 0 ]]; then
+	# Offline version, absence of eclasses is expected => note
+	cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
+	<note>
+	The offline version of the devmanual does not include the documentation
+	for the eclasses.
+	</note>
+	</body>
+	EOF
+else
+	# Otherwise, presumably something went wrong => warning
 	cat <<- 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
 	<warning>
 	This is only a placeholder. If you see this text in the output document,
 	then the eclass documentation is missing.
 	</warning>
+	</body>
 	EOF
-else
-	echo '<ul class="list-group">' >> "${OUTPUTDIR}"/text.xml || exit 1
-	for i in $(find "${OUTPUTDIR}" -maxdepth 1 -mindepth 1 -type d | sort); do
-		echo "<li><uri link=\"$(basename $i)/index.html\">$(basename $i)</uri></li>" >> "${OUTPUTDIR}"/text.xml || exit 1
-	done
-	echo '</ul>' >> "${OUTPUTDIR}"/text.xml || exit 1
 fi
 
 cat << 'EOF' >> "${OUTPUTDIR}"/text.xml || exit 1
-</body>
-</section>
 </chapter>
 </guide>
 EOF


             reply	other threads:[~2024-10-29 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 11:19 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-10-05 19:00 [gentoo-commits] proj/devmanual:master commit in: /, bin/ Ulrich Müller
2022-03-26 19:12 Ulrich Müller
2020-02-28  6:26 Ulrich Müller
2020-01-22 18:24 Ulrich Müller
2019-12-19 21:02 Göktürk Yüksek
2019-12-16  6:45 Ulrich Müller
2019-12-14 10:46 Ulrich Müller
2019-03-22 18:51 Brian Evans
2019-03-22 13:27 Brian Evans

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=1730200638.f9abc1d4273dc6dc2a61e13105f435c61a8f24ba.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@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