Adding Custom `man` Pages From Markdown Notes
I recently found out it’s surprisingly easy to add your own man
pages from Markdown notes.
Just add the path to the MANPATH
environment variable:
export MANPATH=$MANPATH:$HOME/.man
Then generate your man pages using pandoc:
pandoc --standalone --to man --from markdown "my-note.md" --output "$HOME/.man/man9/my-note.9"
The 9
is the man
page section, I chose 9
for my own notes because there weren’t many existing man
pages in that section. This means I can tab complete from only my notes by typing for example man 9 my-⇥
.