Applying patch provided in issue #7797.
Fixes to man-pages:
- Character '-' must be espaced as '\-'
- Surround preformatted text with '.nf' and '.fi' to adjust filling
- Give every page a NAME section for indexing by mandb
- Pass the man page filename without extension to .TH in its header
Also added a title to the HTML header.
- Previously all links started in 'command_' which led to conflicts
and was confusing for non-command items.
- Use a per-section name that is meaningful to humans.
- Fix link id names to be valid HTML.