Adds / tweaks a bunch of scripts
This commit is contained in:
parent
887f479d1f
commit
285165913d
13 changed files with 112 additions and 30 deletions
|
@ -12,18 +12,17 @@
|
|||
# config.h files: (For suckless utils) recompiles and installs program.
|
||||
# all others: run `sent` to show a presentation
|
||||
|
||||
echo "$1"
|
||||
file=$(readlink -f "$1")
|
||||
dir=$(dirname "$file")
|
||||
file="$(readlink -f "$1")"
|
||||
dir="$(dirname "$file")"
|
||||
base="${file%.*}"
|
||||
shebang=$(sed -n 1p "$file")
|
||||
shebang="$(sed -n 1p "$file")"
|
||||
|
||||
cd "$dir" || exit
|
||||
|
||||
textype() { \
|
||||
command="pdflatex"
|
||||
( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex"
|
||||
$command --output-directory="$dir" "$file"
|
||||
command="latexmk -pdf"
|
||||
( sed 5q "$file" | grep -i -q 'xelatex' ) && command="latexmk -pdfxe"
|
||||
$command -output-directory="$dir" "$file"
|
||||
#grep -i addbibresource "$file" >/dev/null &&
|
||||
#biber --input-directory "$dir" "$base" &&
|
||||
#$command --output-directory="$dir" "$base" &&
|
||||
|
@ -36,7 +35,7 @@ mdtype(){ \
|
|||
case "$command" in
|
||||
"fplreport") pandoc "$file" --metadata-file="$HOME/.pandoc/defaults.yaml" --template fellowship.latex --pdf-engine=xelatex -o "${base}.pdf" ;;
|
||||
"letter") pandoc "$file" --metadata-file="$HOME/.pandoc/defaults.yaml" --template template-letter.tex -o "${base}.pdf" ;;
|
||||
*) pandoc "$file" -f markdown+pipe_tables --metadata-file="$HOME/.pandoc/defaults.yaml" -o "$base".pdf ;;
|
||||
*) pandoc "$file" -f markdown+pipe_tables --metadata-file="$HOME/.pandoc/defaults.yaml" -o "$base".pdf ;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -60,7 +59,7 @@ case "$file" in
|
|||
*\.c) cc "$file" -o "$base" && "$base" ;;
|
||||
*\.py) python "$file" ;;
|
||||
*\.js) cat "$file" | minify --js > "${base}.min.js" ;;
|
||||
*\.less) lessc --clean-css "$file" "${base}.min.css" ;;
|
||||
*\.less) lessc --clean-css -x "$file" "${base}.min.css" ;;
|
||||
#*\.less) lessc "$file" "${base}.css" ;;
|
||||
#*\.go) go run "$file" ;;
|
||||
#*) shebangtest ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue