🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #320

Re: Internal navigation in the online manual

#320
From: Christian Weisgerber
Date: Sun, 01 Nov 2026 20:50
43 lines
3428 bytes
On 2026-10-31, Carlos E. R. <robin_listas@es.invalid> wrote:

> No, man pages do not contain links to section of the document. It is not 
> structured.

There are two roff macro sets for man pages: man(7) and mdoc(7).

man(7) is poorly structured.  mdoc(7), which originated in 4.4BSD
but is now widely available, provides semantic markup.  With mdoc(7),
the structure is there, it's up to the downstream tools to use it.

The HTML output mode of Kristaps Dzonsons' mandoc(1) formatter,
which appears to have spread to all BSDs, seems to mostly limit
itself to providing lots of #anchors as potential targets for
linking, e.g.:
https://man.openbsd.org/ls

When you are piping formatted text into less(1), there are few
possibilities.  OpenBSD's man(1) uses mandoc(1) to dump various
definitions into a temporary ctags(1) file that is passed to
less -T.  So when I run "man ls" and want to know what the -u option
does, I can jump straight to it by entering ":tu".  That can be
very useful when navigating long manpages, such as got(1) from Game
of Trees, where I can jump directly to the subcommand I want to
look up.

mdoc(7)'s semantic markup also allows for a more powerful apropos(1)
that, for instance, allows you to seach for all man pages that
mention the type "struct stat":

$ apropos Vt='struct stat'
stat(1) - display file status
fhopen, fhstat, fhstatfs(2) - access file via file handle
getfsstat(2) - get list of all mounted file systems
pledge(2) - restrict system operations
stat, fstat, fstatat, lstat, S_ISBLK, S_ISCHR, S_ISDIR, S_ISFIFO,
S_ISLNK, S_ISREG, S_ISSOCK(2) - get file status
statfs, fstatfs(2) - get file system statistics
ftw, nftw(3) - traverse (walk) a file tree
...

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de
Technical Details
Message-ID: <slrn11ef9g6.1il7.naddy@lorvorc.mips.inka.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
References: <18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com> <11bg381$1bjd2$1@dont-email.me> <RH-dnS_Dp6SSsEH3nZ2dnZfqnPednZ2d@giganews.com> <11bhv61$1bjd2$2@dont-email.me> <11bi77v$20c1p$1@news.xmission.com> <11binqk$1bjd2$3@dont-email.me> <pLicnUOiRttbS0P3nZ2dnZfqn_GdnZ2d@giganews.com> <11bmnvg$36mvk$1@dont-email.me> <pLicnX-iRtvwnkL3nZ2dnZfqn_GdnZ2d@giganews.com> <11bp7nd$139t9$2@dont-email.me> <1omdnboFafC6TX33nZ2dnZfqn_GdnZ2d@giganews.com> <11brekh$139ta$4@dont-email.me> <zyidnfr4e4AiInz3nZ2dnZfqnPidnZ2d@giganews.com> <76sES.99248$xwD5.81928@fx47.iad> <nkfho2F6rc9U5@mid.individual.net> <11bvs57$3gfju$3@dont-email.me> <VMSdnS91V7mP13n3nZ2dnZfqnPadnZ2d@giganews.com> <fa6FS.16031$WY1.1843@fx06.iad> <nkluscFas32U2@mid.individual.net> <11c4h4n$1025g$5@dont-email.me> <nkmrv0FftpsU7@mid.individual.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: Christian Weisgerber <naddy@mips.inka.de>
Newsgroups: comp.os.linux.misc,comp.unix.shell
Subject: Re: Internal navigation in the online manual
Date: Sun, 1 Nov 2026 20:50:14 -0000 (UTC)
Message-ID: <slrn11ef9g6.1il7.naddy@lorvorc.mips.inka.de>
References: <18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com>
 <11bg381$1bjd2$1@dont-email.me>
 <RH-dnS_Dp6SSsEH3nZ2dnZfqnPednZ2d@giganews.com>
 <11bhv61$1bjd2$2@dont-email.me> <11bi77v$20c1p$1@news.xmission.com>
 <11binqk$1bjd2$3@dont-email.me>
 <pLicnUOiRttbS0P3nZ2dnZfqn_GdnZ2d@giganews.com>
 <11bmnvg$36mvk$1@dont-email.me>
 <pLicnX-iRtvwnkL3nZ2dnZfqn_GdnZ2d@giganews.com>
 <11bp7nd$139t9$2@dont-email.me>
 <1omdnboFafC6TX33nZ2dnZfqn_GdnZ2d@giganews.com>
 <11brekh$139ta$4@dont-email.me>
 <zyidnfr4e4AiInz3nZ2dnZfqnPidnZ2d@giganews.com>
 <76sES.99248$xwD5.81928@fx47.iad> <nkfho2F6rc9U5@mid.individual.net>
 <11bvs57$3gfju$3@dont-email.me>
 <VMSdnS91V7mP13n3nZ2dnZfqnPadnZ2d@giganews.com>
 <fa6FS.16031$WY1.1843@fx06.iad> <nkluscFas32U2@mid.individual.net>
 <11c4h4n$1025g$5@dont-email.me> <nkmrv0FftpsU7@mid.individual.net>
Injection-Date: Sun, 1 Nov 2026 20:50:14 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
	logging-data="52948"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/pre1.0.4-9 (FreeBSD)