2014-08-11 15:52:25 |
Volker Siegel |
description |
It would be very useful if the Ubuntu online man pages in HTML would have section anchors.
For a detailed use case description, see this question:
http://askubuntu.com/questions/509799/online-man-pages-with-links-to-subsections
What is needed it to add an anchor tag <a> with a file-relative url to all kinds of headers,
ideally including command and option names of the defining paragraphs.
As intuitive anchor names are central, I propose to use the item text without spaces,
and cleaned up preferring stripping chars over escaping.
For the section "Parameter Expansion", the derived anchor url would be
"#ParameterExpansion".
This method will lead to some fraction of duplicate anchor names, for example if the
cleaned-up form is the same for two distinct items.
I think that should be explicitly tollerated.
Ambiguous anchors are prety common in general HTML, the browser may decide which to use.
As an example, the HTML code of the header of section "Parameter Expansion" from
http://manpages.ubuntu.com/bash
which kind-of-redirects to
http://manpages.ubuntu.com/manpages/trusty/en/man1/bash.1.html
currently looks like this:
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 anchor URL:
`<b>Parameter</b> <b>Expansion</b>`
to
`<a href="#ParameterExpansion"><b>Parameter</b> <b>Expansion</b></a>`
Now, we can link to the section "Parameter Expansion" of "man bash" like
http://manpages.ubuntu.com/manpages/trusty/en/man1/bash.1.html#ParameterExpansion
or even
http://manpages.ubuntu.com/bash#ParameterExpansion
----
See also:
http://askubuntu.com/questions/509799/online-man-pages-with-links-to-subsections
https://bugs.launchpad.net/ubuntu-manpage-repository/+bug/871815 |
It would be very useful if the Ubuntu online man pages in HTML would have section anchors.
For a detailed use case description, see this question:
http://askubuntu.com/questions/509799/online-man-pages-with-links-to-subsections
What is needed it to add an anchor tag <a> with a file-relative url to all kinds of headers,
ideally including command and option names of the defining paragraphs.
As intuitive anchor names are central, I propose to use the item text without spaces,
and cleaned up preferring stripping chars over escaping.
For the section "Parameter Expansion", the derived anchor url would be
"#ParameterExpansion".
This method will lead to some fraction of duplicate anchor names, for example if the
cleaned-up form is the same for two distinct items.
I think that should be explicitly tollerated.
Ambiguous anchors are prety common in general HTML, the browser may decide which to use.
As an example, the HTML code of the header of section "Parameter Expansion" from
http://manpages.ubuntu.com/bash
which kind-of-redirects to
http://manpages.ubuntu.com/manpages/trusty/en/man1/bash.1.html
currently looks like this:
[ ... ]
tildes in assignments to <b>PATH</b>, <b>MAILPATH</b>, and ... assigns the expanded value.
<b>Parameter</b> <b>Expansion</b>
The `<b>$</b>' character introduces parameter expansion, command...
or arithmetic expansion. The parameter name or symbol to be ...
[ ... ]
To be able to link directly to this section, we need something like:
[ ... ]
tildes in assignments to <b>PATH</b>, <b>MAILPATH</b>, and ... assigns the expanded value.
<a href="#ParameterExpansion"><b>Parameter</b> <b>Expansion</b></a>
The `<b>$</b>' character introduces parameter expansion, command... or arithmetic expansion. The parameter name or symbol to be ...
[ ... ]
This adds one tag to the HTML code, and one attribute, the anchor URL:
`<b>Parameter</b> <b>Expansion</b>`
to
`<a href="#ParameterExpansion"><b>Parameter</b> <b>Expansion</b></a>`
Now, we can link to the section "Parameter Expansion" of "man bash" like
http://manpages.ubuntu.com/manpages/trusty/en/man1/bash.1.html#ParameterExpansion
or even
http://manpages.ubuntu.com/bash#ParameterExpansion
----
See also:
http://askubuntu.com/questions/509799/online-man-pages-with-links-to-subsections
https://bugs.launchpad.net/ubuntu-manpage-repository/+bug/871815 |
|