pandoc-md: rename to pandoc-make and major update
This commit is contained in:
parent
b364d1b9c8
commit
12087a1655
2 changed files with 19 additions and 6 deletions
19
.config/shell/bin/pandoc-make
Executable file
19
.config/shell/bin/pandoc-make
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Simple script for compiling/converting documents with pandoc because I can never remember how to use it
|
||||||
|
|
||||||
|
# Usage:
|
||||||
|
# pandoc-make html *.md
|
||||||
|
|
||||||
|
|
||||||
|
# echo "Convert to... (default: html)"
|
||||||
|
# read -r FORMAT
|
||||||
|
|
||||||
|
FORMAT="${1:-html}"
|
||||||
|
FIRST=true
|
||||||
|
|
||||||
|
for FILE in "$@";do
|
||||||
|
[ $FIRST ] && FIRST=false && continue
|
||||||
|
if [ -f "$FILE" ]; then
|
||||||
|
pandoc -s "$FILE" -o "${FILE%.*}.${FORMAT##.}"
|
||||||
|
fi
|
||||||
|
done
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
if [ -f "$1.md" ]; then
|
|
||||||
pandoc -s "$1.md" -o "$1.html"
|
|
||||||
else
|
|
||||||
echo "Please specify a file name (without the .md extension)"
|
|
||||||
fi
|
|
Loading…
Add table
Add a link
Reference in a new issue