summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2016-08-10 15:56:36 -0700
committerFranck Cuny <franck.cuny@gmail.com>2016-08-10 15:56:36 -0700
commit97463f6f5d86855eba39896fc838f3e2b0f0a295 (patch)
treea262b79738ac44e1cd4734a4802a0d5157fb7bc0
parent[emacs] Add configuration for Makefile (diff)
downloademacs.d-97463f6f5d86855eba39896fc838f3e2b0f0a295.tar.gz
[bash] function to preview markdown
New bash function to render a preview of a markdown file.

Closes #8.
-rw-r--r--bashrc7
1 files changed, 7 insertions, 0 deletions
diff --git a/bashrc b/bashrc
index 5bcf568..ab12158 100644
--- a/bashrc
+++ b/bashrc
@@ -46,3 +46,10 @@ alias gonest="ssh -K nest.smfc.twitter.com"
 [ -d "/opt/twitter/opt/go/libexec/bin" ] && PATH="/opt/twitter/opt/go/libexec/bin:${PATH}"
 [ -d "/opt/twitter/bin" ] && PATH="/opt/twitter/bin:${PATH}"
 [ -f /opt/twitter/rvm/scripts/rvm ] && source /opt/twitter/rvm/scripts/rvm
+
+md_prev() {
+  FILE="${1}"
+  pandoc -f markdown_github \
+         -c https://goo.gl/OVmlwT \
+         --self-contained "${FILE}" > /tmp/md_prev && open /tmp/md_prev
+}