From 529158ab26c3bf0f8a353eba7b59e1000272b9e7 Mon Sep 17 00:00:00 2001 From: Bob Stayton Date: Fri, 19 Oct 2012 21:16:44 +0000 Subject: [PATCH] Add parameter 'activate.external.olinks' to allow making external olinks inactive, as for epub output. --- xsl/common/olink.xsl | 39 ++++++++++---- xsl/epub3/epub3-element-mods.xsl | 3 ++ xsl/fo/param.ent | 1 + xsl/fo/param.xweb | 2 + xsl/html/param.ent | 1 + xsl/html/param.xweb | 2 + xsl/params/activate.external.olinks.xml | 69 +++++++++++++++++++++++++ 7 files changed, 106 insertions(+), 11 deletions(-) create mode 100755 xsl/params/activate.external.olinks.xml diff --git a/xsl/common/olink.xsl b/xsl/common/olink.xsl index c892dd747..bfb95a455 100644 --- a/xsl/common/olink.xsl +++ b/xsl/common/olink.xsl @@ -548,19 +548,36 @@ + + + + + + 1 + 1 + 1 + 0 + + + 1 + + + - - - - + + + + + + + + + + - - - - diff --git a/xsl/epub3/epub3-element-mods.xsl b/xsl/epub3/epub3-element-mods.xsl index 64f262946..445146c8f 100644 --- a/xsl/epub3/epub3-element-mods.xsl +++ b/xsl/epub3/epub3-element-mods.xsl @@ -52,6 +52,9 @@ article toc,title,figure,table,example,equation + + + 0 diff --git a/xsl/fo/param.ent b/xsl/fo/param.ent index 79de10b11..6ee9ad27a 100644 --- a/xsl/fo/param.ent +++ b/xsl/fo/param.ent @@ -358,3 +358,4 @@ + diff --git a/xsl/fo/param.xweb b/xsl/fo/param.xweb index a65ff7b31..0f0f8a85c 100644 --- a/xsl/fo/param.xweb +++ b/xsl/fo/param.xweb @@ -167,6 +167,7 @@ generate.section.toc.level; Linking ¤t.docid; +&activate.external.olinks; &collect.xref.targets; &insert.olink.page.number; &insert.olink.pdf.frag; @@ -564,6 +565,7 @@ around all these parameters. + diff --git a/xsl/html/param.ent b/xsl/html/param.ent index 8434ea670..23bfb38d6 100644 --- a/xsl/html/param.ent +++ b/xsl/html/param.ent @@ -328,3 +328,4 @@ + diff --git a/xsl/html/param.xweb b/xsl/html/param.xweb index c16c328b8..7a719aa96 100644 --- a/xsl/html/param.xweb +++ b/xsl/html/param.xweb @@ -208,6 +208,7 @@ $Id$ &use.local.olink.style; ¤t.docid; &olink.doctitle; +&activate.external.olinks; &olink.debug; &olink.properties; &olink.lang.fallback.sequence; @@ -457,6 +458,7 @@ around all these parameters. ******************************************************************** --> + diff --git a/xsl/params/activate.external.olinks.xml b/xsl/params/activate.external.olinks.xml new file mode 100755 index 000000000..a28686c76 --- /dev/null +++ b/xsl/params/activate.external.olinks.xml @@ -0,0 +1,69 @@ + + +activate.external.olinks +boolean + + +activate.external.olinks +Make external olinks into active links + + + + + + + + +Description + +If activate.external.olinks is nonzero +(the default), then any olinks that reference another document +become active links that can be clicked on to follow the link. +If the parameter is set to zero, then external olinks +will have the appropriate link text generated, but the link is +not made active. Olinks to destinations in +the current document remain active. + +To make an external olink active for HTML +outputs, the link text is wrapped in an a +element with an href attribute. To +make an external olink active for FO outputs, the link text is +wrapped in an fo:basic-link element with an +external-destination attribute. + +This parameter is useful when you need external olinks +to resolve but not be clickable. For example, if documents +in a collection are available independently of each other, +then having active links between them could lead to +unresolved links when a given target document is missing. + +The epub stylesheets set this parameter to zero by default +because there is no standard linking mechanism between Epub documents. + +If external links are made inactive, you should +consider setting the +stylesheet parameter olink.doctitle +to yes. That will append the external document's +title to the link text, making it easier for the user to +locate the other document. + +An olink is considered external when the +current.docid stylesheet parameter +is set to some value, and the olink's targetdoc +attribute has a different value. If the two values +match, then the link is considered internal. If the +current.docid parameter is blank, or +the olink element does not have a targetdoc attribute, +then the link is considered to be internal and will become +an active link. + +See also olink.doctitle, +prefer.internal.olink. + + + -- 2.40.0