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 Possible fileformats see: https://pandoc.org/diagram.svgz?v=20230203095535
|
||||
echo Examples:
|
||||
echo: md -> pdf : pandocPipeline -u "Dokumentbearbeiter" -t "Dokumententitel" -f dateiname -e pdf
|
||||
echo: md -> docx : pandocPipeline -f dateiname -e docx
|
||||
}
|
||||
|
||||
Error() {
|
||||
echo An error occured
|
||||
echo Try 'pandocPipeline --help' for more information
|
||||
echo md -> pdf : pandocPipeline -u "Dokumentbearbeiter" -t "Dokumententitel" -f dateiname -e pdf
|
||||
echo md -> docx : pandocPipeline -f dateiname -e docx
|
||||
}
|
||||
|
||||
Errorfile() {
|
||||
|
|
@ -35,12 +30,13 @@ echo Please add a filename to your command
|
|||
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=()
|
||||
|
||||
#eval set -- "$ARGS"
|
||||
|
||||
#while true; do
|
||||
while [[ $# -gt 0 ]]; do
|
||||
echo $1
|
||||
echo $2
|
||||
|
|
@ -58,7 +54,7 @@ while [[ $# -gt 0 ]]; do
|
|||
ending="$2"
|
||||
shift 2;;
|
||||
-v|--version)
|
||||
echo mktex $version
|
||||
echo pandocPipeline $version
|
||||
exit;;
|
||||
-h|--help)
|
||||
Help
|
||||
|
|
@ -68,17 +64,10 @@ while [[ $# -gt 0 ]]; do
|
|||
esac
|
||||
done
|
||||
|
||||
echo Editor $editor
|
||||
echo Title $title
|
||||
|
||||
if [[ -z "$file" ]]; then
|
||||
Errorfile
|
||||
exit
|
||||
fi
|
||||
|
||||
echo $ending
|
||||
|
||||
if [[ "$ending" == "pdf" ]]; then
|
||||
elif [[ "$ending" == "pdf" ]]; then
|
||||
header=$script/header.md
|
||||
echo $header
|
||||
sedfile=$script/body.sed
|
||||
|
|
@ -92,5 +81,12 @@ if [[ "$ending" == "pdf" ]]; then
|
|||
sed -i 's,textwidth]{.*,textwidth]{'"$picture"'}},' $header
|
||||
echo 3
|
||||
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
|
||||
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