Skip to content

Commit 148afb0

Browse files
committed
Add a function for previewing Markdown in the browser
1 parent 3e39ad6 commit 148afb0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rc.d/60-better-reading.zsh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Better reading tools configuration
22

3+
# Preview markdown in browser
4+
mdp() {
5+
local tmp=$(mktemp /tmp/mdpreview-XXXX.html)
6+
pandoc -s --metadata title="${1:t:r}" -t html "$1" -o "$tmp" && xdg-open "$tmp"
7+
}
8+
39
# Sets Moor as our pager
410

511
export MOOR='--no-linenumbers'

0 commit comments

Comments
 (0)