Skip to main content

Installation

pip install pnu-mtoc

MTOC(1)

NAME

mtoc - show Manual table of contents

SYNOPSIS

mtoc [-f|--file|--whatis FILE] [-n|--no MACROS] [-t|--type] [--Dq] [--Pa|--PaSq] [--PaDq] [--Xr] [--debug] [--help|-?] [--version] [--] [SECTION ...]

DESCRIPTION

The mtoc utility shows the Manual table of contents.

Without arguments, it will list the Manual sections listed in man man.

With arguments, it will list the contents of the requested Manual sections in whatis(1) format.

The display can be a little bit improved over standard whatis format by using the --Dq, --Pa, --PaSq, --PaDq and --Xr options, in order to interpret the corresponding mdoc(7) macros.

It can also be used as a database-less substitute of whatis, by using the -f, --file or --whatis options on a Manual page's pathname.

It is possible to discard man(7) or mdoc(7) pages by using the -n or --no options with a man or mdoc parameter.

The -t or --type options will add the type of man page after a pipe character: man, mdoc, other, so(X):{man, mdoc, other}, with X indicating the number of redirections (more than 3 will cause an error in order to prevent loops).

The -f and -n options can be used multiple times.

OPTIONS

Options Use
-f|--file|--whatis FILE Process a specific file, like whatis(1)
-n|--no MACROS Discard man or mdoc macros
-t|--type Print type of man page (ie. man, mdoc, other, so)
--Dq Interpret .Dq (double quotes) macros
--Pa|--PaSq Interpret .Pa (path) macros as single quoted strings
--PaDq Interpret .Pa (path) macros as double quoted strings
--Xr Interpret .Xr (cross reference) macros
--debug Enable debug mode
--help|-? Print usage and a short help message and exit
--version Print version and exit
-- Options processing terminator

ENVIRONMENT

The MTOC_DEBUG environment variable can also be set to any value to enable debug mode.

The mtoc utility uses the MANPATH environment variable to find man pages. It provides default values both for Unix-like and Windows operating systems.

Locale man pages can be processed if the path where they are stored is added to MANPATH.

Under Windows, the command can use the APPDATA, HOMEPATH and USERPROFILE environment variables to find man pages.

EXIT STATUS

The mtoc utility exits 0 on success, and >0 if an error occurs.

SEE ALSO

man(1), whatis(1), apropos(1), man(7), mandoc_char(7), mdoc(7), roff(7)

STANDARDS

The mtoc utility is not a standard UNIX command.

It tries to follow the PEP 8 style guide for Python code.

PORTABILITY

Tested OK under Windows.

HISTORY

This utility was made for The PNU project in order to explore providing a Manual under non-Unix operating systems. This turned out to be way more complex than anticipated, forcing me to delve much more deeply in roff(7) macros than originally intended!

Check this excellent History of UNIX Manpages.

LICENSE

This utility is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

CAVEATS

The order of names in a man page is sorted alphabetically, which sometimes differ from whatis(1) output. I couldn't find the logic behind whatis behaviour...

It isn't currently possible to process:

  • architecture-dependent man pages (for example, in /usr/share/man/man[48]/{aarch64, amd64, arm, i386, powerpc})
  • already uncompressed man pages (for example, in /usr/share/man/cat[1-9])

Release files for pnu-mtoc 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pnu-mtoc 1.1.3
File Size Uploaded
pnu_mtoc-1.1.3.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pnu-mtoc 1.1.3
File Interpreter ABI Platform
pnu_mtoc-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / pnu_mtoc-1.1.3.tar.gz

Download URL pnu_mtoc-1.1.3.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
799711e654f3bd24da0ca339436252c821a7f0547572b7d126ce5999ac9713b4
BLAKE2b-256 checksum
How to use checksums
816740d18e3b732dc2af3c15ce783808a7bac31cd817c5ef148755e2167e1438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release files / pnu_mtoc-1.1.3-py3-none-any.whl

Download URL pnu_mtoc-1.1.3-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b3674bb3bb3ebca22963936eb62b8d96de0e1557cc837310eda21421830ba46
BLAKE2b-256 checksum
How to use checksums
088818d1181c993ef220d9ea129b6069cd2a7719c2f216f6a868787152f37004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page