aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-04 21:34:40 +0100
committerFlorian Dold <florian@dold.me>2024-03-04 21:34:40 +0100
commit1f813f5e70addb00b3207128728d0832691d4154 (patch)
tree0af68ad292ea1f3443a56c4f993d8e504cc91d1e
parented9f1e1c3d64b60166ba4c4ea6c5ca0216a7c3b0 (diff)
taler-terms-generator: use pandocv0.9.5-dev.3
-rwxr-xr-xcontrib/taler-terms-generator45
1 files changed, 19 insertions, 26 deletions
diff --git a/contrib/taler-terms-generator b/contrib/taler-terms-generator
index 2dd35cc18..d83a8801d 100755
--- a/contrib/taler-terms-generator
+++ b/contrib/taler-terms-generator
@@ -256,15 +256,7 @@ for d in en $(ls -d ${LOCALE_DIR}/?? | grep -v "en" 2>/dev/null || true); do
LBUILD="sphinx-build -D language=${LANGUAGE} -d ${BUILDDIR}/.doctrees"
- echo "$VERSION_BASENAME TXT ($LANGUAGE)..." 1>&2
- # shellcheck disable=SC2090
- $LBUILD \
- -b text \
- "${BUILDDIR}" \
- "${BUILDDIR}/txt" \
- &>"${BUILDDIR}/txt-sphinx.log" ||
- failcat "${BUILDDIR}/txt-sphinx.log"
- mv "${BUILDDIR}/txt/${VERSION_BASENAME}.txt" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.txt"
+ OUTBASE="${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}"
echo "$VERSION_BASENAME MD ($LANGUAGE)..." 1>&2
$LBUILD \
@@ -273,28 +265,29 @@ for d in en $(ls -d ${LOCALE_DIR}/?? | grep -v "en" 2>/dev/null || true); do
"${BUILDDIR}/md" \
&>"${BUILDDIR}/md-sphinx.log" ||
failcat "${BUILDDIR}/md-sphinx.log"
- mv "${BUILDDIR}/md/${VERSION_BASENAME}.md" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.md"
+ BUILDFILE_MARKDOWN="${BUILDDIR}/md/${VERSION_BASENAME}.md"
+ cp "$BUILDFILE_MARKDOWN" "${OUTBASE}.md"
+
+ # Convert the generated Markdown (!) to other formats.
echo "$VERSION_BASENAME PDF ($LANGUAGE)..." 1>&2
- mkdir -p "${BUILDDIR}/pdf/"
- # Convert the generated Markdown (!) to PDF.
pandoc \
- -i "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.md" \
- -o "${BUILDDIR}/pdf/${VERSION_BASENAME}.pdf" \
- --pdf-engine=pdfroff
- mv "${BUILDDIR}/pdf/${VERSION_BASENAME}.pdf" "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.pdf"
+ -i "$BUILDFILE_MARKDOWN" \
+ -o "${OUTBASE}.pdf" \
+ --pdf-engine=pdfroff \
+ --shift-heading-level-by=-1
echo "$VERSION_BASENAME HTML ($LANGUAGE)..." 1>&2
- # shellcheck disable=SC2090
- $LBUILD \
- -b html \
- "${BUILDDIR}" \
- "${BUILDDIR}/html" \
- &>"${BUILDDIR}/html-sphinx.log" ||
- failcat "${BUILDDIR}/html-sphinx.log"
- htmlark \
- -o "${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.html" \
- "${BUILDDIR}/html/${VERSION_BASENAME}.html"
+ pandoc \
+ -i "$BUILDFILE_MARKDOWN" \
+ -o "${OUTBASE}.html" \
+ --embed-resources --standalone \
+ --shift-heading-level-by=-1
+
+ echo "$VERSION_BASENAME TXT ($LANGUAGE)..." 1>&2
+ pandoc \
+ -i "$BUILDFILE_MARKDOWN" \
+ -o "${OUTBASE}.txt"
done
if [[ $INCREMENTAL -eq 1 ]]; then