From 94b15ff4f639093e60d5980e2c89a1062d617578 Mon Sep 17 00:00:00 2001 From: "m.haas" Date: Wed, 7 Jun 2023 10:35:39 +0200 Subject: [PATCH] Erste Funktion --- pandocPipeline/pandocPipeline.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/pandocPipeline/pandocPipeline.sh b/pandocPipeline/pandocPipeline.sh index 63a6c27..b594184 100755 --- a/pandocPipeline/pandocPipeline.sh +++ b/pandocPipeline/pandocPipeline.sh @@ -3,7 +3,7 @@ version=1.0 editor=$USER title='' -file=none +file= ending=tex # path to this script script=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd) @@ -64,13 +64,20 @@ while true; do esac done -echo $script -scriptpath=$script -echo $scriptpath - -scriptpath+=/header.txt -echo $scriptpath if [[ -z "$file" ]]; then Errorfile exit fi + +if [[ "$ending" == "pdf" ]] + header=$script/header.md + sedfile=$script/body.sed + picture=$script/Logo.png + sed -i 's,Editor:.*,Editor: '$editor' \\\\\\\\,' $header + sed -i 's,Title:.*,Title: '$title',' $header + sed -i 's,textwidth]{.*,textwidth]{'%picture%'}},' $header + cat %file%.md $header | sed -E -f $sedfile| pandoc --filter $pandocenv --number-sections --toc -i - -o $file.pdf + xdg-open $file.pdf +fi + +