by h1d · 8y ago · 0 comments
I'm using pandoc to convert it to groff and read it like a formatted man page, which is ok but not great as it loses some formatting.
pandoc -s -f markdown -t man markdown.md | groff -T utf8 -man | less -R #!/bin/bash
# ~/.lessfilter
case $1 in
*.md) view-md $1;;
*.json) jq -C . $1;;
*) pygmentize $1;;
esac
Where view-md is just a thin wrapper around tty-markdown[1]: #!/usr/bin/env ruby
require 'tty-markdown'
puts TTY::Markdown.parse(ARGF.read, colors: 256)
[1]: https://github.com/piotrmurach/tty-markdown