{"id":22837396,"url":"https://github.com/hubtou/mtoc","last_synced_at":"2026-04-28T20:06:06.495Z","repository":{"id":57453823,"uuid":"386040645","full_name":"HubTou/mtoc","owner":"HubTou","description":"Show (Unix) Manual table of contents","archived":false,"fork":false,"pushed_at":"2021-09-26T15:44:37.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T21:48:47.216Z","etag":null,"topics":["command-line-tool","learning-python","learning-unix","mdoc","pnu-project","python","shell","tools","unix","utilities"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HubTou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-14T18:34:49.000Z","updated_at":"2022-10-04T21:25:04.000Z","dependencies_parsed_at":"2022-08-29T06:51:21.811Z","dependency_job_id":null,"html_url":"https://github.com/HubTou/mtoc","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubTou%2Fmtoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubTou%2Fmtoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubTou%2Fmtoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HubTou%2Fmtoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HubTou","download_url":"https://codeload.github.com/HubTou/mtoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246412748,"owners_count":20773050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","learning-python","learning-unix","mdoc","pnu-project","python","shell","tools","unix","utilities"],"created_at":"2024-12-12T23:16:41.680Z","updated_at":"2026-04-28T20:06:06.460Z","avatar_url":"https://github.com/HubTou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installation\npip install [pnu-mtoc](https://pypi.org/project/pnu-mtoc/)\n\n# MTOC(1)\n\n## NAME\nmtoc - show Manual table of contents\n\n## SYNOPSIS\n**mtoc**\n\\[-f|--file|--whatis FILE\\]\n\\[-n|--no MACROS\\]\n\\[-t|--type\\]\n\\[--Dq\\]\n\\[--Pa|--PaSq\\]\n\\[--PaDq\\]\n\\[--Xr\\]\n\\[--debug\\]\n\\[--help|-?\\]\n\\[--version\\]\n\\[--\\]\n\\[SECTION ...\\]\n\n## DESCRIPTION\nThe **mtoc** utility shows the [Manual](https://www.freebsd.org/cgi/man.cgi) table of contents.\n\nWithout arguments, it will list the Manual sections listed in [man man](https://www.freebsd.org/cgi/man.cgi?query=man).\n\nWith arguments, it will list the contents of the requested Manual sections in [whatis(1)](https://www.freebsd.org/cgi/man.cgi?query=whatis) format.\n\nThe display can be a little bit improved over standard whatis format by using the *--Dq*, *--Pa*, *--PaSq*, *--PaDq* and *--Xr* options,\nin order to interpret the corresponding [mdoc(7)](https://www.freebsd.org/cgi/man.cgi?query=mdoc\u0026sektion=7) macros.\n\nIt 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.\n\nIt is possible to discard [man(7)](https://www.freebsd.org/cgi/man.cgi?query=man\u0026sektion=7)\nor [mdoc(7)](https://www.freebsd.org/cgi/man.cgi?query=mdoc\u0026sektion=7) pages\nby using the *-n* or *--no* options with a *man* or *mdoc* parameter.\n\nThe *-t* or *--type* options will add the type of man page after a pipe character: man, mdoc, other, so(X):{man, mdoc, other},\nwith X indicating the number of redirections (more than 3 will cause an error in order to prevent loops).\n\nThe *-f* and *-n* options can be used multiple times.\n\n### OPTIONS\nOptions | Use\n------- | ---\n-f\\|--file\\|--whatis FILE|Process a specific file, like whatis(1)\n-n\\|--no MACROS|Discard man or mdoc macros\n-t\\|--type|Print type of man page (ie. man, mdoc, other, so)\n--Dq|Interpret .Dq (double quotes) macros\n--Pa\\|--PaSq|Interpret .Pa (path) macros as single quoted strings\n--PaDq|Interpret .Pa (path) macros as double quoted strings\n--Xr|Interpret .Xr (cross reference) macros\n--debug|Enable debug mode\n--help\\|-?|Print usage and a short help message and exit\n--version|Print version and exit\n--|Options processing terminator\n\n## ENVIRONMENT\nThe **MTOC_DEBUG** environment variable can also be set to any value to enable debug mode.\n\nThe **mtoc** utility uses the **MANPATH** environment variable to find man pages.\nIt provides default values both for Unix-like and Windows operating systems.\n\nLocale man pages can be processed if the path where they are stored is added to **MANPATH**.\n\nUnder Windows, the command can use the **APPDATA**, **HOMEPATH** and **USERPROFILE** environment variables to find man pages.\n\n## EXIT STATUS\nThe **mtoc** utility exits 0 on success, and \u003e0 if an error occurs.\n\n## SEE ALSO\n[man(1)](https://www.freebsd.org/cgi/man.cgi?query=man),\n[whatis(1)](https://www.freebsd.org/cgi/man.cgi?query=whatis),\n[apropos(1)](https://www.freebsd.org/cgi/man.cgi?query=apropos),\n[man(7)](https://www.freebsd.org/cgi/man.cgi?query=man\u0026sektion=7),\n[mandoc_char(7)](https://www.freebsd.org/cgi/man.cgi?query=mandoc_char\u0026sektion=7),\n[mdoc(7)](https://www.freebsd.org/cgi/man.cgi?query=mdoc\u0026sektion=7),\n[roff(7)](https://www.freebsd.org/cgi/man.cgi?query=roff\u0026sektion=7)\n\n## STANDARDS\nThe **mtoc** utility is not a standard UNIX command.\n\nIt tries to follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for [Python](https://www.python.org/) code.\n\n## PORTABILITY\nTested OK under Windows.\n\n## HISTORY\nThis utility was made for [The PNU project](https://github.com/HubTou/PNU) in order to explore providing a Manual under non-Unix operating systems.\nThis turned out to be way more complex than anticipated, forcing me to delve much more deeply in [roff(7)](https://www.freebsd.org/cgi/man.cgi?query=roff\u0026sektion=7) macros than originally intended!\n\nCheck this excellent [History of UNIX Manpages](http://manpages.bsd.lv/history.html).\n\n## LICENSE\nThis utility is available under the [3-clause BSD license](https://opensource.org/licenses/BSD-3-Clause).\n\n## AUTHORS\n[Hubert Tournier](https://github.com/HubTou)\n\n## CAVEATS\nThe order of names in a man page is sorted alphabetically, which sometimes differ from whatis(1) output.\nI couldn't find the logic behind whatis behaviour...\n\nIt isn't currently possible to process:\n* architecture-dependent man pages (for example, in /usr/share/man/man[48]/{aarch64, amd64, arm, i386, powerpc})\n* already uncompressed man pages (for example, in /usr/share/man/cat[1-9])\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubtou%2Fmtoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubtou%2Fmtoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubtou%2Fmtoc/lists"}