From 12087a165567d6caec6e1dbc25917b70f0fdd0fa Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 16 Mar 2022 01:32:08 -0700 Subject: [PATCH] pandoc-md: rename to pandoc-make and major update --- .config/shell/bin/pandoc-make | 19 +++++++++++++++++++ .config/shell/bin/pandoc-md | 6 ------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100755 .config/shell/bin/pandoc-make delete mode 100755 .config/shell/bin/pandoc-md diff --git a/.config/shell/bin/pandoc-make b/.config/shell/bin/pandoc-make new file mode 100755 index 0000000..181991f --- /dev/null +++ b/.config/shell/bin/pandoc-make @@ -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 diff --git a/.config/shell/bin/pandoc-md b/.config/shell/bin/pandoc-md deleted file mode 100755 index e10e733..0000000 --- a/.config/shell/bin/pandoc-md +++ /dev/null @@ -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