Man page sections for a command are printed in the order specified by manual as given to Cmdliner.Cmd.info. Unless specified explicitly in the command's manual the following sections are automatically created and populated for you:
The various doc documentation strings specified by the command's term arguments get inserted at the end of the documentation section they respectively mention in their docs argument:
Cmdliner.Cmd.info.Cmdliner.Arg.info. Those are listed iff both the docv and doc string is specified by Cmdliner.Arg.info.Cmdliner.Arg.info.Cmdliner.Cmd.Exit.info.Cmdliner.Arg.env_var and Cmdliner.Cmd.Env.info.If a docs section name is mentioned and does not exist in the command's manual, an empty section is created for it, after which the doc strings are inserted, possibly prefixed by boilerplate text (e.g. for Cmdliner.Manpage.s_environment and Cmdliner.Manpage.s_exit_status).
If the created section is:
Cmdliner.Manpage.s_synopsis if there is no such section.Cmdliner.Manpage.s_commands section or the first subsequent existing standard section if it doesn't exist. Taking advantage of this behaviour is discouraged, you should declare manually your non standard section in the command's manual page.Finally note that the header of empty sections are dropped from the output. This allows you to share section placements among many commands and render them only if something actually gets inserted in it.
Manpage blocks and doc strings support the following markup language.
$(i,text) and $(b,text), where text is raw text respectively rendered in italics and bold.$(var) are substituted by marked up data. For example in a term's man page $(tname) is substituted by the term name in bold."\\$", "\\(", "\\)", "\\\\"). Escaping $ and \ is mandatory everywhere. Escaping ) is mandatory only in markup directives. Escaping ( is only here for your symmetric pleasure. Any other sequence of characters starting with a \ is an illegal character sequence.