Online man pages in HTML with section anchors?
It would be good to have an online version of the Ubuntu man pages with direct links into subsections. That would allow to point someone to the relevant documentation in many cases - for example in answers of various StackExchange sites.
I will describe how a full solution might look, and in which ways that would be useful. I do not think a complete solution is available somewhere,so the question is
Which partial solutions exist today?
For example, somehow systematic ways to search into the man pages, instead of linking, would be a partial solution.
The man pages at manpages.ubuntu.com solve most of the problem, but they do not have anchors on the headings or sections.
That means, if I want to point to the section "Parameter Expansion" in
man bash online, I have to use
See "Parameter Expansion" in
[...and use your browser to search for "Parameter Expansion"]
This opens the bash man page at the top, as one long web page.
In the shell, I can say
man bash | less "+/Parameter Expansion"
which jumps to the right place at startup.
It would be really helpful to have link anchors named like the headings they point to. Anchors named by some kind of index number would still help, but require a manual lookup on the actual web page to use it.
As it is not difficult on HTML level to add anchors to headings, I'm sure such man pages exist;
But is there a collection of the Ubuntu man pages with anchors online somewhere, or at least a good subset?
The header of section "Parameter Expansion" from
which kind-of-redirects to
[ ... ] tildes in assignments to <b>PATH</b>, <b>MAILPATH</b>, and <b>CDPATH</b>, and the shell assigns the expanded value. <b>Parameter</b> <b>Expansion</b> The `<b>$</b>' character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded [ ... ]
To be able to link directly to this section, we need something like:
[ ... ] tildes in assignments to <b>PATH</b>, <b>MAILPATH</b>, and <b>CDPATH</b>, and the shell assigns the expanded value. <a href="#ParameterExpansion"><b>Parameter</b> <b>Expansion</b></a> The `<b>$</b>' character introduces parameter expansion, command substitution, or arithmetic expansion. The parameter name or symbol to be expanded [ ... ]
This adds one tag to the HTML code, and one attribute, the section name without spaces:
<a href="#ParameterExpansion"><b>Parameter</b> <b>Expansion</b></a>
Now, we can link to the section like
which uses a foot note and is is written like
Use of other reference documents
In many cases, there are alternative reference documents available, appart from the man page. These often have a good link structure that is used to link from a table of content to the sections, just what we need.
But this does not solve the general problem, as there is no common way to find whether/where such a document existst, and to make use of the link structure.
For the bash example used above, the Bash Reference Manual could be used as an individual solution looked up manually:
Bash Reference Manual section Shell-Parameter-Expansion
[Bash Reference Manual section Shell-Parameter-Expansion](http://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion)
To propose actually implementing this idea at manpages.ubuntu.com,
I filed a closely related bug/enhancement request on the associated project "ubuntu-manpage-repository": launchpad #1355271: Use HTML a tags to allow external links to subsections of man pages