possibly finished
This commit is contained in:
parent
0aaf9a43eb
commit
b5fb5498aa
1 changed files with 18 additions and 22 deletions
|
|
@ -20,13 +20,8 @@ echo -t, --title enter title of document set between "" \(only fo
|
||||||
echo Pipeline is optimized for target format pdf and docx but works with others as well
|
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 Possible fileformats see: https://pandoc.org/diagram.svgz?v=20230203095535
|
||||||
echo Examples:
|
echo Examples:
|
||||||
echo: md -> pdf : pandocPipeline -u "Dokumentbearbeiter" -t "Dokumententitel" -f dateiname -e pdf
|
echo md -> pdf : pandocPipeline -u "Dokumentbearbeiter" -t "Dokumententitel" -f dateiname -e pdf
|
||||||
echo: md -> docx : pandocPipeline -f dateiname -e docx
|
echo md -> docx : pandocPipeline -f dateiname -e docx
|
||||||
}
|
|
||||||
|
|
||||||
Error() {
|
|
||||||
echo An error occured
|
|
||||||
echo Try 'pandocPipeline --help' for more information
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Errorfile() {
|
Errorfile() {
|
||||||
|
|
@ -35,12 +30,13 @@ echo Please add a filename to your command
|
||||||
echo Try 'pandocPipeline --help' for more information
|
echo Try 'pandocPipeline --help' for more information
|
||||||
}
|
}
|
||||||
|
|
||||||
# ARGS=$(getopt -a --options hvutfe --long "help, version, user, title, file, ending" -- "$@")
|
Open() {
|
||||||
|
xdg-open $file.$ending
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
POSITIONAL_ARGS=()
|
POSITIONAL_ARGS=()
|
||||||
|
|
||||||
#eval set -- "$ARGS"
|
|
||||||
|
|
||||||
#while true; do
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
echo $1
|
echo $1
|
||||||
echo $2
|
echo $2
|
||||||
|
|
@ -58,7 +54,7 @@ while [[ $# -gt 0 ]]; do
|
||||||
ending="$2"
|
ending="$2"
|
||||||
shift 2;;
|
shift 2;;
|
||||||
-v|--version)
|
-v|--version)
|
||||||
echo mktex $version
|
echo pandocPipeline $version
|
||||||
exit;;
|
exit;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
Help
|
Help
|
||||||
|
|
@ -68,17 +64,10 @@ while [[ $# -gt 0 ]]; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo Editor $editor
|
|
||||||
echo Title $title
|
|
||||||
|
|
||||||
if [[ -z "$file" ]]; then
|
if [[ -z "$file" ]]; then
|
||||||
Errorfile
|
Errorfile
|
||||||
exit
|
exit
|
||||||
fi
|
elif [[ "$ending" == "pdf" ]]; then
|
||||||
|
|
||||||
echo $ending
|
|
||||||
|
|
||||||
if [[ "$ending" == "pdf" ]]; then
|
|
||||||
header=$script/header.md
|
header=$script/header.md
|
||||||
echo $header
|
echo $header
|
||||||
sedfile=$script/body.sed
|
sedfile=$script/body.sed
|
||||||
|
|
@ -92,5 +81,12 @@ if [[ "$ending" == "pdf" ]]; then
|
||||||
sed -i 's,textwidth]{.*,textwidth]{'"$picture"'}},' $header
|
sed -i 's,textwidth]{.*,textwidth]{'"$picture"'}},' $header
|
||||||
echo 3
|
echo 3
|
||||||
cat $file.md $header | sed -E -f $sedfile| pandoc --filter pandoc-latex-environment --number-sections --toc -i - -o $file.pdf
|
cat $file.md $header | sed -E -f $sedfile| pandoc --filter pandoc-latex-environment --number-sections --toc -i - -o $file.pdf
|
||||||
xdg-open $file.pdf
|
Open
|
||||||
fi
|
elif [[ "$ending" == "docx" ]]; then
|
||||||
|
refdoc=$script/custom-reference.docx
|
||||||
|
pandoc $file.md --reference-doc=$refdoc -f markdown -t $ending -s -o $file.$ending
|
||||||
|
Open
|
||||||
|
else
|
||||||
|
pandoc $file.md -f markdown -t $ending -s -o $file.$ending
|
||||||
|
Open
|
||||||
|
fi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue