feat: Add build.sh/dev.sh with LANG arg
This commit is contained in:
parent
9bbfdafb5c
commit
262afbb425
5 changed files with 32 additions and 12 deletions
Binary file not shown.
|
|
@ -1241,12 +1241,12 @@ x
|
||||||
endstream
|
endstream
|
||||||
endobj
|
endobj
|
||||||
315 0 obj
|
315 0 obj
|
||||||
<</Creator(Typst 0.15.1)/ModDate(D:20260910122044+02'00)/CreationDate(D:20260910122044+02'00)>>
|
<</Creator(Typst 0.15.1)/ModDate(D:20260911111821+02'00)/CreationDate(D:20260911111821+02'00)>>
|
||||||
endobj
|
endobj
|
||||||
316 0 obj
|
316 0 obj
|
||||||
<</Length 996/Type/Metadata/Subtype/XML>>
|
<</Length 996/Type/Metadata/Subtype/XML>>
|
||||||
stream
|
stream
|
||||||
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><xmp:CreatorTool>Typst 0.15.1</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2026-09-10T12:20:44+02:00</xmp:ModifyDate><xmp:CreateDate>2026-09-10T12:20:44+02:00</xmp:CreateDate><xmpTPg:NPages>8</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>jAfoPMgY5G7aMlUjnGImJQ==</xmpMM:InstanceID><xmpMM:DocumentID>jAfoPMgY5G7aMlUjnGImJQ==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
|
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="xmp-writer"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" ><xmp:CreatorTool>Typst 0.15.1</xmp:CreatorTool><dc:language><rdf:Bag><rdf:li>en</rdf:li></rdf:Bag></dc:language><xmp:ModifyDate>2026-09-11T11:18:21+02:00</xmp:ModifyDate><xmp:CreateDate>2026-09-11T11:18:21+02:00</xmp:CreateDate><xmpTPg:NPages>8</xmpTPg:NPages><dc:format>application/pdf</dc:format><xmpMM:InstanceID>VkAfYY0Sdfg4RWJhs1teCg==</xmpMM:InstanceID><xmpMM:DocumentID>VkAfYY0Sdfg4RWJhs1teCg==</xmpMM:DocumentID><xmpMM:RenditionClass>proof</xmpMM:RenditionClass><pdf:PDFVersion>1.7</pdf:PDFVersion></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="r"?>
|
||||||
endstream
|
endstream
|
||||||
endobj
|
endobj
|
||||||
317 0 obj
|
317 0 obj
|
||||||
|
|
@ -1573,7 +1573,7 @@ xref
|
||||||
0000092468 00000 n
|
0000092468 00000 n
|
||||||
0000093541 00000 n
|
0000093541 00000 n
|
||||||
trailer
|
trailer
|
||||||
<</Size 318/Root 317 0 R/Info 315 0 R/ID[(jAfoPMgY5G7aMlUjnGImJQ==)(jAfoPMgY5G7aMlUjnGImJQ==)]>>
|
<</Size 318/Root 317 0 R/Info 315 0 R/ID[(VkAfYY0Sdfg4RWJhs1teCg==)(VkAfYY0Sdfg4RWJhs1teCg==)]>>
|
||||||
startxref
|
startxref
|
||||||
93745
|
93745
|
||||||
%%EOF
|
%%EOF
|
||||||
|
|
@ -5,8 +5,19 @@ basedir="$(realpath "$basedir")"
|
||||||
cd "$basedir"
|
cd "$basedir"
|
||||||
name="$(basename "$(pwd)")"
|
name="$(basename "$(pwd)")"
|
||||||
|
|
||||||
if ! typst compile --root .. ./main.typ ./"$name".pdf; then
|
# Check if we want to run against a certain translation
|
||||||
echo "Failed to compile $name/main.typ. Please fix errors and run me again."
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Please specify the language you want to build (eg. fr)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGETLANG="$1"
|
||||||
|
SOURCEFILE="main.${TARGETLANG}.typ"
|
||||||
|
TARGETFILE="$name".$TARGETLANG.pdf
|
||||||
|
TARGETFILEBOOK="$name".${TARGETLANG}-book.pdf
|
||||||
|
|
||||||
|
if ! typst compile --root .. ./"$SOURCEFILE" ./"$TARGETFILE"; then
|
||||||
|
echo "Failed to compile "$name"/"$SOURCEFILE". Please fix errors and run me again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -18,7 +29,7 @@ if ! command -v pdfbook2; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
t="$(mktemp --suffix=.pdf)"
|
t="$(mktemp --suffix=.pdf)"
|
||||||
typst compile --input format=booklet --root .. ./main.typ "$t"
|
typst compile --input format=booklet --root .. ./"$SOURCEFILE" "$t"
|
||||||
|
|
||||||
# Need to be in the folder there for it to work, otherwise it
|
# Need to be in the folder there for it to work, otherwise it
|
||||||
# tries to rename from current partition to /tmp which of course fails
|
# tries to rename from current partition to /tmp which of course fails
|
||||||
|
|
@ -30,6 +41,5 @@ cd "$parent"
|
||||||
pdfbook2 --paper=a4paper "$t" --no-crop --outer-margin=0 --inner-margin=0 --top-margin=0 --bottom-margin=0
|
pdfbook2 --paper=a4paper "$t" --no-crop --outer-margin=0 --inner-margin=0 --top-margin=0 --bottom-margin=0
|
||||||
|
|
||||||
cd "$basedir"
|
cd "$basedir"
|
||||||
newFinalFile="$name"-book.pdf
|
cp "$newFile" "$TARGETFILEBOOK"
|
||||||
cp "$newFile" "$newFinalFile"
|
echo "Booklet available in $TARGETFILEBOOK"
|
||||||
echo "Booklet available in $newFinalFile"
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,23 @@
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
name="$(basename "$(pwd)")"
|
name="$(basename "$(pwd)")"
|
||||||
|
|
||||||
|
# Check if we want to run against a certain translation
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo "Please specify the language you want to build (eg. fr)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
TARGETLANG="$1"
|
||||||
|
SOURCEFILE="main.${TARGETLANG}.typ"
|
||||||
|
|
||||||
|
|
||||||
t="$(mktemp --suffix=.pdf)"
|
t="$(mktemp --suffix=.pdf)"
|
||||||
if ! typst compile --root .. ./main.typ "$t"; then
|
if ! typst compile --root .. ./"$SOURCEFILE" "$t"; then
|
||||||
echo "Failed to compile $name/main.typ. Please fix errors and run me again."
|
echo "Failed to compile $name/"$SOURCEFILE". Please fix errors and run me again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Initial compilation successful. Now starting watch mode. Opening $t"
|
echo "Initial compilation successful. Now starting watch mode. Opening $t"
|
||||||
xdg-open "$t"
|
xdg-open "$t"
|
||||||
|
|
||||||
typst watch --root .. ./main.typ "$t"
|
typst watch --root .. ./"$SOURCEFILE" "$t"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue