From 5b132bf1244a008ad3ce67688030a7678831f77d Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Fri, 23 Oct 2015 03:14:36 -0300 Subject: Initial commit --- scripts/markdown-mine | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 scripts/markdown-mine (limited to 'scripts/markdown-mine') diff --git a/scripts/markdown-mine b/scripts/markdown-mine new file mode 100755 index 0000000..6505be7 --- /dev/null +++ b/scripts/markdown-mine @@ -0,0 +1,64 @@ +#!/bin/bash + +begin_of_html() { + cat > "$1" < + + + + + + +EOF +} + +_OUTFILE="$2" +_INFILE="$1" + +main() { + begin_of_html "$_OUTFILE" + /usr/bin/markdown "$_INFILE" >> "$_OUTFILE" + echo "" >> "$_OUTFILE" +} + +case $1 in + --help|-h) + echo "$0 file.md out.html" + exit 0 + ;; + *) + if [[ $# -ne 2 ]] + then + echo "Invalid arguments!" + echo "$0 file.md out.html" + else + main + fi + exit 1 + ;; +esac -- cgit v1.2.3-70-g09d2