Markdown Workflow Part I
Nov 20, 2014Markdown for documenting
I have created the first small bash script to help ease my Markdown workflow.
Usage:
whatchme.sh file.md 'grep "^#" file.md'
Here comes the script (can be found in my GitHub repository for cloning/forking as well!). I found most of it in a forum, thanks to that guys!
#!/bin/bash
# Script by Hannes Lehmann
# Use it, when you need it
if (( $# < 2 )); then
echo "Not enough arguments passed to whatchme!"
echo "Provide the filename as first argument,"
echo "and the command to be executed as second argument."
echo "example: whatchme.sh file.md 'grep something file.md'"
exit 1
fi
while true
do
ATIME=`stat -c %Z $1`
if [[ "$ATIME" != "$LTIME" ]]
then
clear
eval $2
LTIME=$ATIME
fi
sleep 1
done
What I do with this script is: run it in a separate / parallel shell to my editor (where I am editing the current markdown document) to have a fast overview of the chapters and their structure.
The next day I will enhance the script with automated chapter numbering to increase the structural view.