Pandoc can convert Markdown to groff man pages.
This (thanks to nenopera's comment):
pandoc -s -f markdown -t man foo.md | man -l -
should do the trick. The -s
option tells it to generate proper headers and footers.
There may be other markdown-to-*roff converters out there; Pandoc just happens to be the first one I found.
Another alternative is the markdown
command (apt-get install markdown
on Debian systems), which converts Markdown to HTML. For example:
markdown README.md | lynx -stdin
(assuming you have the lynx
terminal-based web browser).
Or (thanks to Danny's suggestion) you can do something like this:
markdown README.md > README.html && xdg-open README.html
where xdg-open
(on some systems) opens the specified file or URL in the preferred application. This will probably open README.html
in your preferred GUI web browser (which isn't exactly "less-style", but it might be useful).
less
? Good luck. – Carrascoless
can certainly display bold and underline; see how man pages are displayed. You just need to convert markdown to somethingless
can handle, perhaps withnroff
as an intermediate step. – Cortisol