diff --git a/pandocPipeline/pandocPipeline.bat b/pandocPipeline/pandocPipeline.bat index 1530c05..a448410 100644 --- a/pandocPipeline/pandocPipeline.bat +++ b/pandocPipeline/pandocPipeline.bat @@ -54,15 +54,13 @@ IF %file%==none (goto :errorfile) ELSE (goto :extract_metadata) :extract_metadata set title=%file% For /F "UseBackQ Tokens=1,*" %%G In ("%file%.md") Do ( - If "%%~G" == "[Title]:" ( + If "%%~G" == "title:" ( set title=%%H ) - If "%%~G" == "[Author]:" ( + If "%%~G" == "author:" ( set editor=%%H ) ) -set title=%title:~3,-1% -set editor=%editor:~3,-1% goto :selection :selection @@ -109,12 +107,8 @@ echo -f, --file specify filename without extension echo -e, --ending spefify target file format echo Pipeline is optimized for target format pdf and docx but works with others as well echo Possible fileformats see: https://pandoc.org/diagram.svgz?v=20230203095535 -echo Author is by default %USERNAME% -echo to change the author write follwing in your markdown file -echo [Author]: # (your name) -echo Title is by default the filename -echo to change the title write follwing in your markdown file -echo [Title]: # (document title) +echo Author is by default %USERNAME% to change the author add the author to the metadata in your markdown file +echo Title is by default the filename to change the title add the title to the metadata in your markdown file goto :end :version diff --git a/pandocPipeline/pandocPipeline.sh b/pandocPipeline/pandocPipeline.sh index d28b17f..18f6e77 100755 --- a/pandocPipeline/pandocPipeline.sh +++ b/pandocPipeline/pandocPipeline.sh @@ -24,12 +24,8 @@ echo Possible fileformats see: https://pandoc.org/diagram.svgz?v=20230203095535 echo Examples: echo md -\> pdf : pandocPipeline -f dateiname -e pdf echo md -\> docx : pandocPipeline -f dateiname -e docx -echo Author is by default $editor -echo to change the author write follwing in your markdown file -echo \[Author\]: \# \(your name\) -echo Title is by default the filename -echo to change the title write follwing in your markdown file -echo \[Title\]: \# \(document title\) +echo Author is by default $editor to change the author add the author to the metadata in your markdown file +echo Title is by default the filename to change the title add the title to the metadata in your markdown file } Errorfile() { @@ -74,10 +70,10 @@ if [[ -z "$file" ]]; then Errorfile exit title=$file -editor=$(grep '\[Author\]: # \(.*\)' $file.md) -editor=${editor:13:-1} -title=$(grep '\[Title\]: # \(.*\)' $file.md) -title=${title:13:-1} +editor=$(grep 'author: .*' $file.md) +editor=${editor:8} +title=$(grep 'title: .*' $file.md) +title=${title:7} if [[ "$ending" == "pdf" ]]; then header=$script/header.md sedfile=$script/body.sed