
New mandoc feature: -T html -O toc (Table of contents) - brynet
https://undeadly.org/cgi?action=article;sid=20181002175838
======
Annatar
It's really cool how they solved it without breaking backward compatibility or
the interface: unless specifically requested, mandoc(1) will work as before,
but the overall capability of the software has been enhanced. That's what I
call system engineering.

------
justinmk
Neovim's ":Man" command also shows a ToC when you type "gO" (mnemonic:
"outline").

See also:

    
    
        :help gO
    

Currently Nvim builds this ToC with its own hacks, so it would be nice to get
that info from mandoc instead. But IIUC, "-O toc" only works with HTML output
of mandoc? How can non-HTML tools get the ToC from mandoc?

~~~
mineo
Similarly, man and woman in Emacs generate a ToC that imenu (M-x imenu) can
use.

------
enriquto
mandoc is great! It could replace legacy man almost everywhere

