From d2b0df310956dba08e1b000c7be6874a1b0cca3d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Mon, 5 Feb 2007 07:20:57 +0000 Subject: [PATCH] Made a number of changes related to elements with out-of-line content: - Added handling for mediaobject & inlinemedidaobject. Each imagedata, audiodata, or videodata element within a mediaobject or inline mediaobject is now treated as a "notesource" and so handled in much the same way as links and annotation/alt/footnotes. That means a numbered marker is generated inline to mark the place in the main flow where the imagedata, audiodata, or videodata element occurs, and a corresponding numbered endnote for it is generated in the endnotes list at the end of the man page; the endnote contains the URL from the fileref attribute of the imagedata, audiodata, or videodata element. For mediobject and inlinemediaobject instances that have a textobject child, the textobject is displayed within the main text flow. - Renamed several man.link.* params to man.endnotes.*, to reflect that fact that the endnotes list now contains more than just links. Also did similar renaming for a number of stylesheet-internal vars. - Added support for xlink:href (along with existing support for the legacy ulink element). - Cleaned up and streamlined the endnotes-handling code. It's still messy and klunky and the basic mechanism it uses is very inefficent for documents that contain a lot of notesources, but at least it's a bit better than it was. --- xsl/manpages/block.xsl | 33 ++ xsl/manpages/docbook.xsl | 6 +- xsl/manpages/inline.xsl | 6 +- xsl/manpages/links.xsl | 459 ++++++++++-------- xsl/manpages/param.ent | 6 +- xsl/manpages/param.xweb | 16 +- ...ered.xml => man.endnotes.are.numbered.xml} | 82 ++-- xsl/params/man.endnotes.list.enabled.xml | 106 ++++ xsl/params/man.endnotes.list.heading.xml | 33 ++ xsl/params/man.links.are.underlined.xml | 12 +- xsl/params/man.links.list.enabled.xml | 95 ---- xsl/params/man.links.list.heading.xml | 32 -- 12 files changed, 501 insertions(+), 385 deletions(-) rename xsl/params/{man.links.are.numbered.xml => man.endnotes.are.numbered.xml} (50%) create mode 100644 xsl/params/man.endnotes.list.enabled.xml create mode 100644 xsl/params/man.endnotes.list.heading.xml delete mode 100644 xsl/params/man.links.list.enabled.xml delete mode 100644 xsl/params/man.links.list.heading.xml diff --git a/xsl/manpages/block.xsl b/xsl/manpages/block.xsl index b9454221a..1751a4528 100644 --- a/xsl/manpages/block.xsl +++ b/xsl/manpages/block.xsl @@ -219,7 +219,39 @@ + + + + + + ⌂sp + + ⌂RS + + + + + + + + ⌂RE + + + + [IMAGE] + + + + + + [ + + ] + + + + @@ -246,6 +278,7 @@ + diff --git a/xsl/manpages/docbook.xsl b/xsl/manpages/docbook.xsl index 3a0b40148..db4cb3ddd 100644 --- a/xsl/manpages/docbook.xsl +++ b/xsl/manpages/docbook.xsl @@ -210,10 +210,10 @@ - + - + diff --git a/xsl/manpages/inline.xsl b/xsl/manpages/inline.xsl index 21f70ba3f..5583ff975 100644 --- a/xsl/manpages/inline.xsl +++ b/xsl/manpages/inline.xsl @@ -146,10 +146,14 @@ - + + + + + diff --git a/xsl/manpages/links.xsl b/xsl/manpages/links.xsl index a332539e1..f0bad2001 100644 --- a/xsl/manpages/links.xsl +++ b/xsl/manpages/links.xsl @@ -3,7 +3,8 @@ xmlns:exsl="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" - exclude-result-prefixes="db ng exsl" + xmlns:xlink="http://www.w3.org/1999/xlink" + exclude-result-prefixes="db ng exsl xlink" version='1.0'> - + + + - - - - - + + + + + - - + + + - - - + + + + + - - - + + - - - - - - - + + + + + - - - + + + - - - - + + + - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + - + - - - - - - - - - - + = generate-id(current()))]/@url) + and not(@xlink:href = + preceding::*[@xlink:href][node() + and not(ancestor::refentryinfo) + and not(ancestor::info) + and not(ancestor::docinfo) + and not(ancestor::refmeta) + and not(ancestor::refnamediv) + and not(ancestor::indexterm) + and (generate-id(ancestor::refentry) + = generate-id(current()))]/@xlink:href) + and not(@fileref = + preceding::*[@fileref][ + not(ancestor::refentryinfo) + and not(ancestor::info) + and not(ancestor::docinfo) + and not(ancestor::refmeta) + and not(ancestor::refnamediv) + and not(ancestor::indexterm) + and (generate-id(ancestor::refentry) + = generate-id(current()))]/@fileref)]"> + + + + + + + + + + + + + + - + - + - - - + + + - - - + + + + select="$all.earmark.indexes.in.current.document/earmark.index + [@idref = + generate-id(current()/ancestor::refentry)]/earmark"/> - - + + + - - + + + + + - - - + + @@ -164,8 +217,9 @@ - - + + + @@ -178,44 +232,63 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + @@ -231,100 +304,74 @@ - - - + + + + + + + + - + + + + + + + - - - - - + + + + + + - + + - + - + + ⌂SH " - - + + - + " - + + + ⌂IP " - + . @@ -339,31 +386,52 @@ - - - - - + + + + - - - - - + + + + + + - + + + + + + + + - - + + + + + + + + + + + + + + + + + ⌂RS - ▓% - + ⌂RE + diff --git a/xsl/manpages/param.ent b/xsl/manpages/param.ent index 5e6915fa8..fc47f70e0 100644 --- a/xsl/manpages/param.ent +++ b/xsl/manpages/param.ent @@ -9,10 +9,10 @@ - + + + - - diff --git a/xsl/manpages/param.xweb b/xsl/manpages/param.xweb index f56817899..84c3fc73f 100644 --- a/xsl/manpages/param.xweb +++ b/xsl/manpages/param.xweb @@ -54,12 +54,12 @@ &man.font.table.headings; &man.font.table.title; - - Link handling -&man.links.are.numbered; + + Endnotes and link handling +&man.endnotes.list.enabled; +&man.endnotes.list.heading; +&man.endnotes.are.numbered; &man.links.are.underlined; -&man.links.list.enabled; -&man.links.list.heading; Lists @@ -169,10 +169,10 @@ - + + + - - diff --git a/xsl/params/man.links.are.numbered.xml b/xsl/params/man.endnotes.are.numbered.xml similarity index 50% rename from xsl/params/man.links.are.numbered.xml rename to xsl/params/man.endnotes.are.numbered.xml index ef4d3b400..a273144a7 100644 --- a/xsl/params/man.links.are.numbered.xml +++ b/xsl/params/man.endnotes.are.numbered.xml @@ -1,69 +1,71 @@ + id="man.endnotes.are.numbered"> -man.links.are.numbered +man.endnotes.are.numbered boolean -man.links.are.numbered -Number links? +man.endnotes.are.numbered +Number endnotes? - -1 + +1 Description -If the value of man.links.are.numbered is +If the value of man.endnotes.are.numbered is non-zero (the default), then for each non-empty -A non-empty link is one that looks like +A “non-empty” notesource is one that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> -an empty link is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> - link: + “notesource”: - a number (in square brackets) is displayed inline before the - rendered contents of the link + a number (in square brackets) is displayed inline after the + rendered inline contents (if any) of the notesource - the URL for the link is included in a numbered list of links - that is generated at the end of each man page; the number for each - links corresponds to the inline number for the link with which it is - associated + the contents of the notesource are included in a + numbered list of endnotes that is generated at the end of + each man page; the number for each endnote corresponds to + the inline number for the notesource with which it is + associated -The default heading for the list of links is -REFERENCES. To output a different heading, set a value +The default heading for the list of endnotes is +NOTES. To output a different heading, set a value for the man.links.section.heading parameter. - The link list is also displayed (but without numbers) if the - value of man.links.list.enabled is - non-zero. + The endnotes list is also displayed (but without + numbers) if the value of + man.links.list.enabled is + non-zero. -If the value of man.links.are.numbered is -zero, numbering of links is suppressed; only the link contents are -displayed inline. +If the value of man.endnotes.are.numbered is +zero, numbering of endnotess is suppressed; only inline +contents (if any) of the notesource are displayed inline. - If you are thinking about disabling link numbering by setting - the value of man.links.are.numbered to zero, + If you are thinking about disabling endnote numbering by setting + the value of man.endnotes.are.numbered to zero, before you do so, first take some time to carefully consider the information needs and experiences of your users. The - square-bracketed numbers displayed inline before links may seem + square-bracketed numbers displayed inline after notesources may seem obstrusive and aesthetically unpleasingYou might - think that it would be better to just display URLs for non-empty + >As far as notesources that are links, ytou might + think it would be better to just display URLs for non-empty links inline, after their content, rather than displaying square-bracketed numbers all over the place. But it's not better. In fact, it's not even practical, because many (most) URLs for links @@ -73,33 +75,29 @@ displayed inline. that, but it could be argued that what you end up with is at least as ugly, and definitely more obstrusive, then having short square-bracketed numbers displayed inline., - - but in a text-only output format, the numbered-links/link-listing - mechanism is the only practical way of associating inline text with - URLs. - Also, users of text based browsers such as + but in a text-only output format, the + numbered-notesources/endnotes-listing mechanism is the only + practical way to handle this kind of content. + + Also, users of “text based” browsers such as lynx will already be accustomed to seeing inline numbers for links. And various "man to html" applications, such as the widely used man2html (VH-Man2html) application, can automatically turn URLs into "real" HTML hyperlinks - in output. So leaving man.links.are.numbered - at its default (non-zero) value ensures that no link information is + in output. So leaving man.endnotes.are.numbered + at its default (non-zero) value ensures that no information is lost in your man-page output. It just gets - rearranged. + “rearranged”. The handling of empty links is not affected by this parameter. Empty links are handled simply by displaying their URLs inline. Empty links are never auto-numbered. - - Currently, this parameter only affects output for - ulinks. - -If you disable link numbering, you should probably also set +If you disable endnotes numbering, you should probably also set man.links.are.underlined to zero (to disable link underlining). diff --git a/xsl/params/man.endnotes.list.enabled.xml b/xsl/params/man.endnotes.list.enabled.xml new file mode 100644 index 000000000..d528ac39a --- /dev/null +++ b/xsl/params/man.endnotes.list.enabled.xml @@ -0,0 +1,106 @@ + + +man.endnotes.list.enabled +boolean + + +man.endnotes.list.enabled +Display endnotes list at end of man page? + + + + +1 + + + +Description + +If the value of man.endnotes.list.enabled is +non-zero (the default), then an endnotes list is added to the end of +the output man page. + +If the value of man.endnotes.list.enabled is +zero, the list is suppressed — unless link numbering is enabled (that +is, if man.endnotes.are.numbered is non-zero), in +which case, that setting overrides the +man.endnotes.list.enabled setting, and the +endnotes list is still displayed. The reason is that inline +numbering of notesources associated with endnotes only makes sense +if a (numbered) list of endnotes is also generated. + + + Leaving + man.endnotes.list.enabled at its default + (non-zero) value ensures that no “out of line” information (such + as the URLs for hyperlinks and images) gets lost in your + man-page output. It just gets “rearranged”. + So if you’re thinking about disabling endnotes listing by + setting the value of + man.endnotes.list.enabled to zero: + Before you do so, first take some time to carefully consider + the information needs and experiences of your users. The “out + of line” information has value even if the presentation of it + in text output is not as interactive as it may be in other + output formats. + As far as the specific case of URLs: Even though the URLs + displayed in text output may not be “real” (clickable) + hyperlinks, many X terminals have convenience features for + recognizing URLs and can, for example, present users with + an options to open a URL in a browser with the user clicks on + the URL is a terminal window. And short of those, users with X + terminals can always manualy cut and paste the URLs into a web + browser. + Also, note that various “man to html” tools, such as the + widely used man2html (VH-Man2html) + application, automatically mark up URLs with into a@href markup + during conversion — resulting in “real” hyperlinks in HTML + output from those tools. + + +To “turn off” numbering of endnotes in the +endnotes list, set man.endnotes.are.numbered +to zero. The endnotes list will +still be displayed; it will just be displayed without the +numbersIt can still make sense to have +the list of endnotes displayed even if you have endnotes numbering turned +off. In that case, your endnotes list basically becomes a “list +of references” without any association with specific text in +your document. This is probably the best option if you find the inline +endnotes numbering obtrusive. Your users will still have access to all the “out of line” +such as URLs for hyperlinks. + + +The default heading for the endnotes list is +NOTES. To change that, set a non-empty +value for the man.endnotes.list.heading +parameter. + +In the case of notesources that are links: Along with the +URL for each link, the endnotes list includes the contents of the +link. The list thus includes only non-empty + +A “non-empty” link is one that looks like +this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> +an “empty link” is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> + links. + +Empty links are never included, and never numbered. They are simply +displayed inline, without any numbering. + +In addition, if there are multiple instances of links in a +refentry that have the same URL, the URL is listed only +once. The contents listed for that link in the endnotes list are +the contents of the first link which has that URL. + +If you disable endnotes listing, you should probably also set +man.links.are.underlined to zero (to disable +link underlining). + + diff --git a/xsl/params/man.endnotes.list.heading.xml b/xsl/params/man.endnotes.list.heading.xml new file mode 100644 index 000000000..893ff4d69 --- /dev/null +++ b/xsl/params/man.endnotes.list.heading.xml @@ -0,0 +1,33 @@ + + +man.endnotes.list.heading +string + + +man.endnotes.list.heading +Specifies an alternate name for endnotes list + + + + + + + + +Description + +If the value of the +man.endnotes.are.numbered parameter +and/or the man.endnotes.list.enabled +parameter is non-zero (the defaults for both are non-zero), a +numbered list of endnotes is generated near the end of each man +page. The default heading for the list of endnotes is the +equivalent of the English word NOTES in +the current locale. To cause an alternate heading to be displayed, +set a non-empty value for the +man.endnotes.list.heading parameter — +for example, REFERENCES. + + diff --git a/xsl/params/man.links.are.underlined.xml b/xsl/params/man.links.are.underlined.xml index 18011e158..9aaefcdcf 100644 --- a/xsl/params/man.links.are.underlined.xml +++ b/xsl/params/man.links.are.underlined.xml @@ -39,8 +39,8 @@ you should probably set a non-zero value for man.links.are.underlined alsoIf the main purpose of underlining of links in most output formats it to indicate that the underlined text is -clickable, given that links rendered in man pages are -not real hyperlinks that users can click on, it might +“clickable”, given that links rendered in man pages are +not “real” hyperlinks that users can click on, it might seem like there is never a good reason to have link contents underlined in man output. In fact, if you suppress the display of inline link references (by setting @@ -48,9 +48,9 @@ display of inline link references (by setting good reason to have links underlined. However, if man.links.are.numbered is non-zero, having links underlined may (arguably) serve a purpose: It provides -context information about exactly what part of the text -is being annotated by the link. Depending on how you -use mark up your content, that context information may or may not have -value.. +“context” information about exactly what part of the text +is being “annotated” by the link. Depending on how you +mark up your content, that context information may or may not +have value.. diff --git a/xsl/params/man.links.list.enabled.xml b/xsl/params/man.links.list.enabled.xml deleted file mode 100644 index f2342fb3d..000000000 --- a/xsl/params/man.links.list.enabled.xml +++ /dev/null @@ -1,95 +0,0 @@ - - -man.links.list.enabled -boolean - - -man.links.list.enabled -Display list of links at end of man page? - - - - -1 - - - -Description - -If the value of man.links.list.enabled is -non-zero (the default), then a list of links is added to the end of -the output man page. - -If the value of man.links.list.enabled is -zero, the list is suppressed -- unless link numbering is enabled (that -is, if man.links.are.numbered is non-zero), in -which case, that setting overrides the -man.links.list.enabled setting, and the link -list is still displayed. The reason is that link numbering only makes -sense if a (numbered) list of links is also generated. - - - Various man to html applications, such as the - widely used man2html (VH-Man2html) - application, can automatically turn URLs into real - HTML hyperlinks in output. So leaving - man.links.list.enabled at its default - (non-zero) value ensures that no link URLs are lost in your man-page - output. They just get rearranged. So if you are - thinking about disabling link listing by setting the value of - man.links.list.enabled to zero, before you do - so, first take some time to carefully consider the information needs - and experiences of your users. The URLs are useful information even - if they aren't real (clickable) hyperlinks. - - -To turn off numbering of links in the list, set -man.links.are.numbered to zero. The list will -still be displayed; it will just be displayed without the -numbersIt can still make sense to have -the list of links displayed even if you have link numbering turned -off. In that case, your list of links basically becomes a list -of references without any association with specific text in -your document. This is probably the best option if you find the inline -link numbering obtrusive. Your users will still have access to the -URLs and link contents, without being annoyed by the presence of -inline link numbering. - - -The default heading for the section in which the list appears is -REFERENCES. To change that, set a non-empty value -for the man.links.list.heading -parameter. - -Along with the URL for each link, the link list includes the contents -of the link. The list thus includes only non-empty - -A non-empty link is one that looks like -this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/">manpages</ulink> -an empty link is on that looks like this: <ulink url="http://docbook.sf.net/snapshot/xsl/doc/manpages/"/> - links. - -Empty links are never included, and never numbered. They are simply -displayed inline, without any numbering. - -In addition, if there are multiple instances of links in a -refentry that have the same URL, the URL is listed only -once. The contents listed for that link are the contents of the first -link which has that URL. - - - Currently, this parameter only affects output for - ulinks. - - -If you disable link listing, you should probably also set -man.links.are.underlined to zero (to disable -link underlining). - - diff --git a/xsl/params/man.links.list.heading.xml b/xsl/params/man.links.list.heading.xml deleted file mode 100644 index 46aaa1160..000000000 --- a/xsl/params/man.links.list.heading.xml +++ /dev/null @@ -1,32 +0,0 @@ - - -man.links.list.heading -string - - -man.links.list.heading -Specifies an alternate name for links list - - - - - - - - -Description - -If the value of the -man.links.are.numbered parameter and/or the -man.links.list.enabled parameter is non-zero -(the defaults for both are non-zero), a numbered list of URLs is -generated near the end of each man page. The default section heading -for the list of links is the equivalent of the English word -REFERENCES in the current locale. To cause an -alternate heading to be displayed, set a non-empty value for the -man.links.list.heading parameter -- for -example, LINKS. - - -- 2.49.0