Convert documentation to man pages #32

Closed
opened 2026-04-09 17:25:38 +02:00 by yestax · 7 comments
Owner

Man pages are preffered over plain text.

They can be seen with man command (Using vim for instance).
They can be searched with apropos command.

It's difficult to make one by hand but it may be easy with pandoc.
Also they may be stored as markdown and generated during package build via dh_auto_build in rules.

Man pages are preffered over plain text. They can be seen with man command (Using vim for instance). They can be searched with apropos command. It's difficult to make one by hand but it may be easy with pandoc. Also they may be stored as markdown and generated during package build via dh_auto_build in rules.
yestax added this to the Setup v1.3.X milestone 2026-04-30 18:51:51 +02:00
Author
Owner
https://eddieantonio.ca/blog/2015/12/18/authoring-manpages-in-markdown-with-pandoc/
Author
Owner

$ pandoc -D man to get a template for man pages

$ pandoc -D man to get a template for man pages
Author
Owner

to generate the file
$ pandoc --standalone --to man filestructure.7.md -o filestructure.7

to read it locally
$ man -l filestructure.7

to generate the file $ pandoc --standalone --to man filestructure.7.md -o filestructure.7 to read it locally $ man -l filestructure.7
Author
Owner
  • base
  • bash
  • debian
  • git
  • packaging
  • python
  • ruby
  • vim
- [X] base - [x] bash - [x] debian - [x] git - [x] packaging - [x] python - [x] ruby - [x] vim
Author
Owner

It is possible to use a custom manual section, to not interact with any other one. It is possible to even use a string.

if stored in /usr/share/man/man


it can be queried with man

If no other names collide it can even be queried with man and will go through all the sections.

This should be useful because a lot of documentation are additional informations on existing utilities. Section 7 is great but can collide (example schroot uses section 7).

mansetup or mankb can be used for instance

It is possible to use a custom manual section, to not interact with any other one. It is possible to even use a string. if stored in /usr/share/man/man<section> it can be queried with man <section> <filename> If no other names collide it can even be queried with man <filename> and will go through all the sections. This should be useful because a lot of documentation are additional informations on existing utilities. Section 7 is great but can collide (example schroot uses section 7). mansetup or mankb can be used for instance
Author
Owner

A 'setup' man section is hard to do since man doesn't recognise setup as a section.
To properly work it needs an entry in /etc/manpath.config otherwise it just thinks it's a man page and search for it.

To avoid collision, an idea is to use a man subsection. For instance .8setup files in man8 dir. Then man search in the section order and can find another page before but it's okay since the page can still be queried with the 8setup fullname.

A 'setup' man section is hard to do since man doesn't recognise setup as a section. To properly work it needs an entry in /etc/manpath.config otherwise it just thinks it's a man page and search for it. To avoid collision, an idea is to use a man subsection. For instance .8setup files in man8 dir. Then man search in the section order and can find another page before but it's okay since the page can still be queried with the 8setup fullname.
Author
Owner

solved by #82

solved by #82
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
yestax/setup#32
No description provided.