News for hackers. Stuff that matters.
Re:Things I Wish I'd Known About Bash by anjbe on Sunday January 07, 2018 @12:04AM (#16089300)
BSD man pages (and many Linux man pages, though a minority) are written in semantic “mdoc” macros, rather than the classic “man” macros that are strictly presentational.

If you’re using mandoc (http://mandoc.bsd.lv/) as your man(1) program—the default on OpenBSD and a couple of Linuxes like Void and Alpine—it will use these semantics to generate hyperlinks in the terminal using more(1) and less(1)’s ctags support.

So on my machine, your example becomes:

    type man foo
    type :t
    type p
This brings me to the first instance of a command‐line flag named “-p” or environment variable named “p” in an itemized list.

It translates to HTML too—check out the links generated by the web viewer, which uses the same backend. https://man.openbsd.org/ls.1

Re:Things I Wish I'd Known About Bash by hyperpape on Sunday January 07, 2018 @07:35PM (#16093752)
That’s awesome! I think a table of contents could be nice addition for the HTML version (at least for pages that are longer than less).