Files
dev-process/tools/generate_word_vorlagen.sh
T
Stefan Lohmaier cc1a2b8129 feat(i18n): tool scripts in English
- tools/build_word_template.py: default field placeholder
- tools/generate_word_vorlagen.sh: header comments
2026-05-12 06:14:24 -07:00

53 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Convert the formal-document Markdown vorlagen to Word .docx
# using slohmaier-doc-template.docx as style reference.
#
# Word is the industry standard for formal release / ISO 9001 audits.
# Markdown remains the source of truth; Word is generated from it.
#
# These templates are converted to Word:
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SRC="$REPO_ROOT/vorlagen"
DST="$REPO_ROOT/vorlagen-word"
TEMPLATE="$DST/slohmaier-doc-template.docx"
if [[ ! -f "$TEMPLATE" ]]; then
echo "Building base Word template first..."
python3 "$REPO_ROOT/tools/build_word_template.py"
fi
# Formal documents (to Word):
FORMAL_DOCS=(
PID-vorlage
PM-Plan-vorlage
QA-Plan-vorlage
SWE-Plan-vorlage
Test-Plan-vorlage
Review-Protokoll-vorlage
Non-Conformity-vorlage
MISRA-Deviation-Permit-vorlage
MISRA-Deviation-Record-vorlage
angebot-vorlage
)
mkdir -p "$DST"
for doc in "${FORMAL_DOCS[@]}"; do
if [[ -f "$SRC/$doc.md" ]]; then
echo "Converting: $doc.md -> $doc.docx"
pandoc "$SRC/$doc.md" \
--reference-doc="$TEMPLATE" \
--toc \
--toc-depth=3 \
-o "$DST/$doc.docx"
else
echo "WARN: $SRC/$doc.md not found, skipping"
fi
done
echo ""
echo "Done. Word templates at: $DST/"
ls -la "$DST/"