aboutsummaryrefslogtreecommitdiff
path: root/pdfs
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2020-05-15 22:32:42 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2020-05-15 22:32:42 +0200
commit6085c2475e6d27c6eba373068b7b9a23787191c7 (patch)
tree3c865550f81ab2966b891ad21ff82a2a4b30e23f /pdfs
parent2c304fb55698747cc5a1143f65bdc0ffade2d261 (diff)
downloadscripts-6085c2475e6d27c6eba373068b7b9a23787191c7.tar.gz
scripts-6085c2475e6d27c6eba373068b7b9a23787191c7.zip
Integrated plantUML in markdown files in toPDF.sh
Diffstat (limited to 'pdfs')
-rwxr-xr-xpdfs/toPDF.sh8
1 files changed, 7 insertions, 1 deletions
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