From 6085c2475e6d27c6eba373068b7b9a23787191c7 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Fri, 15 May 2020 22:32:42 +0200 Subject: Integrated plantUML in markdown files in toPDF.sh --- pdfs/toPDF.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pdfs/toPDF.sh b/pdfs/toPDF.sh index 4761f37..0134803 100755 --- a/pdfs/toPDF.sh +++ b/pdfs/toPDF.sh @@ -22,6 +22,8 @@ targetFile="${targetDir}/${sourceFile##*/}" targetFile="${targetFile%.*}.pdf" extension="${sourceFile##*.}" texengine="xelatex" +pandocLuaScriptsFolder="$XDG_CONFIG_HOME/pandoc/luascripts" +pandocPlantUmlLuaScript="diagram-generator.lua" [ -d "$targetDir" ] || mkdir -p "$targetDir" @@ -30,7 +32,11 @@ case "$extension" in "$texengine" -output-directory "$targetDir" "$sourceFile" ;; *) - pandoc "$sourceFile" -o "$targetFile" > ~/logs/toPDF.log + plantUmlCode="" + plantUmlScriptPath="${pandocLuaScriptsFolder}/${pandocPlantUmlLuaScript}" + [ -f "$plantUmlScriptPath" ] && [ -n "$PLANTUML" ] && + plantUmlCode="--lua-filter $plantUmlScriptPath" + pandoc --pdf-engine=xelatex "$sourceFile" $plantUmlCode -o "$targetFile" > ~/logs/toPDF.log ;; esac -- cgit v1.2.1