website-build: untitled: Add patch to add texinfo support

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-10-12 17:42:09 +02:00
parent adc578ae49
commit b7030e428d
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
2 changed files with 70 additions and 1 deletions

View File

@ -20,6 +20,9 @@ EX_USAGE=64
untitled_uri="https://notabug.org/untitled/untitled.git"
untitled_path=""
untitled_commit="6941ffefe04375296732565a4628b549eea54a64"
untitled_patches="\
patches/0001-Add-basic-support-for-texinfo-files.patch \
"
help()
{
@ -40,6 +43,7 @@ sync_repo()
src_uri="$2"
src_path="$3"
src_revision="$4"
src_patches="$5"
if [ -z "${src_path}" ] && [ ! -d "${dst_path}" ] ; then
git clone "${src_uri}" "${dst_path}"
@ -65,6 +69,18 @@ sync_repo()
git -C "${dst_path}" checkout "${src_revision}"
fi
fi
if git -C "${dst_path}" status | \
grep '^rebase in progress;' > /dev/null ; then
git -C "${dst_path}" am --abort
fi
for patch in ${src_patches} ; do
GIT_COMMITTER_EMAIL="noreply@gnuboot.gnu.org" \
GIT_COMMITTER_NAME="website-build" \
git -C "${dst_path}" am $(realpath ${patch})
done
}
copy_website()
@ -112,7 +128,8 @@ done
set -e
sync_repo "untitled" \
"${untitled_uri}" "${untitled_path}" "${untitled_commit}"
"${untitled_uri}" "${untitled_path}" \
"${untitled_commit}" "${untitled_patches}"
copy_website "untitled/www/lbwww/"
cd untitled

View File

@ -0,0 +1,52 @@
From 9a4ca3519f5081d21e80c7e57046080138baf3fe Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Date: Wed, 16 Aug 2023 19:25:53 +0200
Subject: [PATCH] Add basic support for texinfo files
This enables a progressive migration toward texi to better integrate
with the GNU standards.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
build | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/build b/build
index 40587ff..55d8521 100755
--- a/build
+++ b/build
@@ -194,6 +194,20 @@ getlangname() {
return 0
}
+# convert pandoc-markdown file into html, using a template file
+mkmarkdown() {
+ FILE=${1%.texi}
+ SITEDIR="www/${2}"
+
+ printf "Generating '%s.md'\n" "${FILE}"
+
+ texi2any --no-validate --no-warn --force --docbook \
+ "${FILE}.texi" -o "${FILE}.xml"
+
+ pandoc --from docbook --to markdown \
+ "${FILE}.xml" -o "${FILE}.md"
+}
+
# convert pandoc-markdown file into html, using a template file
mkhtml() {
FILE=${1%.md}
@@ -818,6 +832,10 @@ buildsite() {
fi
TESTDIR="${TESTDIR##$(pwd)/${SITEDIR}/site/}"
+ for texifile in $(find -L ${SITEDIR}/site/ -name '*.texi'); do
+ mkmarkdown "${texifile}" "${SITEDIR##*/}"
+ done
+
for mdfile in $(find -L ${SITEDIR}/site/ -name '*.md'); do
mkhtml "${mdfile}" "${SITEDIR##*/}" "${TITLE}" "${CSS}" \
"${DEFAULTLANG}" "${LAZY}"
--
2.41.0