]> granicus.if.org Git - docbook-dsssl/commitdiff
Added a first cut at support for DocBook 5 style annotations
authorNorman Walsh <ndw@nwalsh.com>
Thu, 14 Jul 2005 14:30:44 +0000 (14:30 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 14 Jul 2005 14:30:44 +0000 (14:30 +0000)
xsl/html/annotations.xsl [new file with mode: 0644]
xsl/html/chunk-code.xsl
xsl/html/docbook.xsl
xsl/html/footnote.xsl
xsl/html/inline.xsl
xsl/html/param.ent
xsl/html/param.xweb
xsl/params/annotation.graphic.close.xml [new file with mode: 0644]
xsl/params/annotation.graphic.open.xml [new file with mode: 0644]
xsl/params/annotation.js.xml [new file with mode: 0644]
xsl/params/annotation.support.xml [new file with mode: 0644]

diff --git a/xsl/html/annotations.xsl b/xsl/html/annotations.xsl
new file mode 100644 (file)
index 0000000..cae9a1d
--- /dev/null
@@ -0,0 +1,165 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version='1.0'>
+
+<xsl:template name="add.annotation.links">
+  <xsl:param name="scripts" select="normalize-space($annotation.js)"/>
+  <xsl:choose>
+    <xsl:when test="contains($scripts, ' ')">
+      <script type="text/javascript" src="{substring-before($scripts, ' ')}"/>
+      <xsl:call-template name="add.annotation.links">
+       <xsl:with-param name="scripts" select="substring-after($scripts, ' ')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <script type="text/javascript" src="{$scripts}"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="annotation"/>
+
+<xsl:template name="apply-annotations">
+  <!-- do any annotations apply to the context node? -->
+  <xsl:variable name="id" select="(@id|@xml:id)[1]"/>
+
+  <xsl:variable name="aids">
+    <xsl:for-each select="//annotation">
+      <xsl:if test="@annotates=$id
+                   or starts-with(@annotates, concat($id, ' '))
+                   or contains(@annotates, concat(' ', $id, ' '))
+                   or substring(@annotates, string-length(@annotates)-3)
+                      = concat(' ', $id)">
+       <xsl:value-of select="generate-id()"/>
+       <xsl:text> </xsl:text>
+      </xsl:if>
+    </xsl:for-each>
+    <xsl:if test="normalize-space(@annotations) != ''">
+      <xsl:call-template name="annotations-pointed-to">
+       <xsl:with-param name="annotations"
+                       select="normalize-space(@annotations)"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+
+  <xsl:if test="$aids != ''">
+    <xsl:call-template name="apply-annotations-by-gid">
+      <xsl:with-param name="gids" select="normalize-space($aids)"/>
+    </xsl:call-template>
+  </xsl:if>
+</xsl:template>
+
+<xsl:template name="annotations-pointed-to">
+  <xsl:param name="annotations"/>
+  <xsl:choose>
+    <xsl:when test="contains($annotations, ' ')">
+      <xsl:variable name='a'
+                   select="key('id', substring-before($annotations, ' '))"/>
+      <xsl:if test="$a">
+       <xsl:value-of select="generate-id($a)"/>
+       <xsl:text> </xsl:text>
+      </xsl:if>
+      <xsl:call-template name="annotations-pointed-to">
+       <xsl:with-param name="annotations"
+                       select="substring-after($annotations, ' ')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:variable name='a'
+                   select="key('id', $annotations)"/>
+      <xsl:if test="$a">
+       <xsl:value-of select="generate-id($a)"/>
+       <xsl:text> </xsl:text>
+      </xsl:if>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template name="apply-annotations-by-gid">
+  <xsl:param name="gids"/>
+
+  <xsl:choose>
+    <xsl:when test="contains($gids, ' ')">
+      <xsl:variable name="gid" select="substring-before($gids, ' ')"/>
+      <xsl:apply-templates select="key('gid', $gid)"
+                          mode="annotation-inline"/>
+      <xsl:call-template name="apply-annotations-by-gid">
+       <xsl:with-param name="gids"
+                       select="substring-after($gids, ' ')"/>
+      </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="key('gid', $gids)"
+                          mode="annotation-inline"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<xsl:template match="annotation" mode="annotation-inline">
+  <xsl:variable name="title">
+    <xsl:choose>
+      <xsl:when test="title">
+       <xsl:value-of select="title"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>[Annotation #</xsl:text>
+       <xsl:number count="annotation" level="any" format="1"/>
+       <xsl:text>]</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <a href="#annot-{generate-id(.)}" title="{$title}"
+     name="anch-{generate-id(.)}" id="anch-{generate-id(.)}">
+    <xsl:attribute name="onClick">
+      <xsl:text>popup_</xsl:text>
+      <xsl:value-of select="generate-id(.)"/>
+      <xsl:text>.showPopup('anch-</xsl:text>
+      <xsl:value-of select="generate-id(.)"/>
+      <xsl:text>'); return false;</xsl:text>
+    </xsl:attribute>
+    <img src="{$annotation.graphic.open}" border="0" alt="{$title}"/>
+  </a>
+</xsl:template>
+
+<xsl:template match="annotation" mode="annotation-popup">
+  <div class="annotation-nocss">
+    <p>
+      <a name="annot-{generate-id(.)}"/>
+      <xsl:text>Annotation #</xsl:text>
+      <xsl:number count="annotation" level="any" format="1"/>
+      <xsl:text>:</xsl:text>
+    </p>
+  </div>
+
+  <div id="popup-{generate-id(.)}" class="annotation-popup">
+    <xsl:if test="string-length(.) &gt; 300">
+      <xsl:attribute name="style">width:400px</xsl:attribute>
+    </xsl:if>
+
+    <xsl:call-template name="annotation-title"/>
+    <div class="annotation-body">
+      <xsl:apply-templates select="*[local-name(.) != 'title']"/>
+    </div>
+    <div class="annotation-close">
+      <a href="#" onclick="popup_{generate-id(.)}.hidePopup();return false;">
+       <img src="{$annotation.graphic.close}" alt="X" border="0"/>
+      </a>
+    </div>
+  </div>
+</xsl:template>
+
+<xsl:template name="annotation-title">
+  <div class="annotation-title">
+    <xsl:choose>
+      <xsl:when test="title">
+       <xsl:apply-templates select="title/node()"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>Annotation</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </div>
+</xsl:template>
+
+</xsl:stylesheet>
index bce27d1555dc9d32d6ef14310a62b1ef0b7985e5..db47799b5e3dc3dee09d99aeeb2fbe63dfab2773 100644 (file)
@@ -1,8 +1,10 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:exsl="http://exslt.org/common"
                 xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
+               xmlns:ng="http://docbook.org/docbook-ng"
+               xmlns:db="http://docbook.org/ns/docbook"
                 version="1.0"
-                exclude-result-prefixes="exsl">
+                exclude-result-prefixes="exsl ng db">
 
 <!-- ********************************************************************
      $Id$
 
 <xsl:template match="/">
   <xsl:choose>
-    <xsl:when test="$rootid != ''">
-      <xsl:choose>
-        <xsl:when test="count(key('id',$rootid)) = 0">
-          <xsl:message terminate="yes">
-            <xsl:text>ID '</xsl:text>
-            <xsl:value-of select="$rootid"/>
-            <xsl:text>' not found in document.</xsl:text>
-          </xsl:message>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:if test="$collect.xref.targets = 'yes' or
-                        $collect.xref.targets = 'only'">
-            <xsl:apply-templates select="key('id', $rootid)"
-                        mode="collect.targets"/>
-          </xsl:if>
-          <xsl:if test="$collect.xref.targets != 'only'">
-            <xsl:apply-templates select="key('id',$rootid)"
-                        mode="process.root"/>
-            <xsl:if test="$tex.math.in.alt != ''">
-              <xsl:apply-templates select="key('id',$rootid)"
-                          mode="collect.tex.math"/>
-            </xsl:if>
-            <xsl:if test="$generate.manifest != 0">
-              <xsl:call-template name="generate.manifest">
-                <xsl:with-param name="node" select="key('id',$rootid)"/>
-              </xsl:call-template>
-            </xsl:if>
-          </xsl:if>
-        </xsl:otherwise>
-      </xsl:choose>
+    <xsl:when test="function-available('exsl:node-set')
+                   and (*/self::ng:* or */self::db:*)">
+      <!-- Hack! If someone hands us a DocBook V5.x or DocBook NG document,
+          toss the namespace and continue. Someday we'll reverse this logic
+          and add the namespace to documents that don't have one.
+          But not before the whole stylesheet has been converted to use
+          namespaces. i.e., don't hold your breath -->
+      <xsl:message>Stripping NS from DocBook 5/NG document.</xsl:message>
+      <xsl:variable name="nons">
+       <xsl:apply-templates mode="stripNS"/>
+      </xsl:variable>
+      <xsl:message>Processing stripped document.</xsl:message>
+      <xsl:apply-templates select="exsl:node-set($nons)"/>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:if test="$collect.xref.targets = 'yes' or
-                    $collect.xref.targets = 'only'">
-        <xsl:apply-templates select="/" mode="collect.targets"/>
-      </xsl:if>
-      <xsl:if test="$collect.xref.targets != 'only'">
-        <xsl:apply-templates select="/" mode="process.root"/>
-        <xsl:if test="$tex.math.in.alt != ''">
-          <xsl:apply-templates select="/" mode="collect.tex.math"/>
-        </xsl:if>
-        <xsl:if test="$generate.manifest != 0">
-          <xsl:call-template name="generate.manifest">
-            <xsl:with-param name="node" select="/"/>
-          </xsl:call-template>
-        </xsl:if>
-      </xsl:if>
+      <xsl:choose>
+       <xsl:when test="$rootid != ''">
+         <xsl:choose>
+           <xsl:when test="count(key('id',$rootid)) = 0">
+             <xsl:message terminate="yes">
+               <xsl:text>ID '</xsl:text>
+               <xsl:value-of select="$rootid"/>
+               <xsl:text>' not found in document.</xsl:text>
+             </xsl:message>
+           </xsl:when>
+           <xsl:otherwise>
+             <xsl:if test="$collect.xref.targets = 'yes' or
+                           $collect.xref.targets = 'only'">
+               <xsl:apply-templates select="key('id', $rootid)"
+                                    mode="collect.targets"/>
+             </xsl:if>
+             <xsl:if test="$collect.xref.targets != 'only'">
+               <xsl:apply-templates select="key('id',$rootid)"
+                                    mode="process.root"/>
+               <xsl:if test="$tex.math.in.alt != ''">
+                 <xsl:apply-templates select="key('id',$rootid)"
+                                      mode="collect.tex.math"/>
+               </xsl:if>
+               <xsl:if test="$generate.manifest != 0">
+                 <xsl:call-template name="generate.manifest">
+                   <xsl:with-param name="node" select="key('id',$rootid)"/>
+                 </xsl:call-template>
+               </xsl:if>
+             </xsl:if>
+           </xsl:otherwise>
+         </xsl:choose>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:if test="$collect.xref.targets = 'yes' or
+                       $collect.xref.targets = 'only'">
+           <xsl:apply-templates select="/" mode="collect.targets"/>
+         </xsl:if>
+         <xsl:if test="$collect.xref.targets != 'only'">
+           <xsl:apply-templates select="/" mode="process.root"/>
+           <xsl:if test="$tex.math.in.alt != ''">
+             <xsl:apply-templates select="/" mode="collect.tex.math"/>
+           </xsl:if>
+           <xsl:if test="$generate.manifest != 0">
+             <xsl:call-template name="generate.manifest">
+               <xsl:with-param name="node" select="/"/>
+             </xsl:call-template>
+           </xsl:if>
+         </xsl:if>
+       </xsl:otherwise>
+      </xsl:choose>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
       </xsl:call-template>
     </div>
   </xsl:if>
+
+  <!-- FIXME: When chunking, only the annotations actually used
+              in this chunk should be referenced. I don't think it
+             does any harm to reference them all, but it adds
+             unnecessary bloat to each chunk. -->
+  <xsl:if test="$annotation.support != 0 and //annotation">
+    <div class="annotation-list">
+      <div class="annotation-nocss">
+       <p>The following annotations are from this essay. You are seeing
+       them here because your browser doesn’t support the user-interface
+       techniques used to make them appear as ‘popups’ on modern browsers.</p>
+      </div>
+
+      <xsl:apply-templates select="//annotation"
+                          mode="annotation-popup"/>
+    </div>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template name="process.chunk.footnotes">
index 43d93444c65b0595384cf2a5d9ec7d5bd0ebeed5..342514da06c7d9b53988a79b71152f9b31d2a526 100644 (file)
@@ -70,6 +70,7 @@
 <xsl:include href="chunker.xsl"/>
 <xsl:include href="html-rtf.xsl"/>
 <xsl:include href="docbookng.xsl"/>
+<xsl:include href="annotations.xsl"/>
 
 <xsl:param name="stylesheet.result.type" select="'html'"/>
 <xsl:param name="htmlhelp.output" select="0"/>
@@ -77,6 +78,7 @@
 <!-- ==================================================================== -->
 
 <xsl:key name="id" match="*" use="@id|@xml:id"/>
+<xsl:key name="gid" match="*" use="generate-id()"/>
 
 <!-- ==================================================================== -->
 
@@ -257,6 +259,71 @@ body { background-image: url('</xsl:text>
 <xsl:template name="system.head.content">
   <xsl:param name="node" select="."/>
 
+  <!-- FIXME: When chunking, only the annotations actually used
+              in this chunk should be referenced. I don't think it
+             does any harm to reference them all, but it adds
+             unnecessary bloat to each chunk. -->
+  <xsl:if test="$annotation.support != 0 and //annotation">
+    <xsl:call-template name="add.annotation.links"/>
+    <script type="text/javascript">
+      <xsl:text>&#10;// Create PopupWindow objects</xsl:text>
+      <xsl:for-each select="//annotation">
+       <xsl:text>&#10;var popup_</xsl:text>
+       <xsl:value-of select="generate-id(.)"/>
+       <xsl:text> = new PopupWindow("popup-</xsl:text>
+       <xsl:value-of select="generate-id(.)"/>
+       <xsl:text>");&#10;</xsl:text>
+       <xsl:text>popup_</xsl:text>
+       <xsl:value-of select="generate-id(.)"/>
+       <xsl:text>.offsetY = 15;&#10;</xsl:text>
+       <xsl:text>popup_</xsl:text>
+       <xsl:value-of select="generate-id(.)"/>
+       <xsl:text>.autoHide();&#10;</xsl:text>
+      </xsl:for-each>
+    </script>
+
+    <style type="text/css">
+/* ======================================================================
+   Annotations
+*/
+
+div.annotation-list  { visibility: hidden;
+                     }
+
+div.annotation-nocss { position: absolute;
+                       visibility: hidden;
+                     }
+
+div.annotation-popup { position: absolute;
+                       z-index: 4;
+                       visibility: hidden;
+                       padding: 0px;
+                       margin: 2px;
+                       border-style: solid;
+                       border-width: 1px;
+                       width: 200px
+                     }
+
+div.annotation-title { padding: 1px;
+                       font-weight: bold;
+                       border-bottom-style: solid;
+                       border-bottom-width: 1px;
+                     }
+
+div.annotation-body  { padding: 2px;
+                     }
+
+div.annotation-body p { margin-top: 0px;
+                        padding-top: 0px;
+                      }
+
+div.annotation-close { position: absolute;
+                       top: 2px;
+                       right: 2px;
+                     }
+    </style>
+  </xsl:if>
+
   <!-- system.head.content is like user.head.content, except that
        it is called before head.content. This is important because it
        means, for example, that <style> elements output by system.head.content
index d14117d8efdfa6825e6bb4b32302ddb1e3587094..c4773c478bbcf441a6d87e5458cffe98b23049d4 100644 (file)
       <xsl:apply-templates select="$footnotes" mode="process.footnote.mode"/>
     </div>
   </xsl:if>
+
+  <xsl:if test="$annotation.support != 0 and //annotation">
+    <div class="annotation-list">
+      <div class="annotation-nocss">
+       <p>The following annotations are from this essay. You are seeing
+       them here because your browser doesn’t support the user-interface
+       techniques used to make them appear as ‘popups’ on modern browsers.</p>
+      </div>
+
+      <xsl:apply-templates select="//annotation"
+                          mode="annotation-popup"/>
+    </div>
+  </xsl:if>
 </xsl:template>
 
 <xsl:template name="process.chunk.footnotes">
index ce663553563c22fe723589f233d0f0338cc0ea42..15d1e94f8f88bad5b2cf6e64054e28306107a99b 100644 (file)
       </xsl:attribute>
     </xsl:if>
     <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
       </xsl:attribute>
     </xsl:if>
     <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
   </code>
 </xsl:template>
 
         </strong>
       </xsl:otherwise>
     </xsl:choose>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
       </xsl:attribute>
     </xsl:if>
     <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
   </em>
 </xsl:template>
 
           </xsl:attribute>
         </xsl:if>
         <xsl:copy-of select="$content"/>
+       <xsl:call-template name="apply-annotations"/>
       </code>
     </xsl:when>
     <xsl:otherwise>
           </xsl:if>
           <xsl:copy-of select="$content"/>
         </code>
+       <xsl:call-template name="apply-annotations"/>
       </strong>
     </xsl:otherwise>
   </xsl:choose>
         </xsl:attribute>
       </xsl:if>
       <xsl:copy-of select="$content"/>
+      <xsl:call-template name="apply-annotations"/>
     </code>
   </em>
 </xsl:template>
       </xsl:attribute>
     </xsl:if>
     <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
   </sup>
 </xsl:template>
 
       </xsl:attribute>
     </xsl:if>
     <xsl:copy-of select="$content"/>
+    <xsl:call-template name="apply-annotations"/>
   </sub>
 </xsl:template>
 
   <span class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:call-template name="person.name"/>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
   <span class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:call-template name="person.name"/>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
   <span class="{name(.)}">
     <xsl:call-template name="anchor"/>
     <xsl:call-template name="person.name"/>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
         <xsl:apply-templates/>
       </xsl:with-param>
     </xsl:call-template>
+    <xsl:call-template name="apply-annotations"/>
   </span>
 </xsl:template>
 
index 29796c789b79913f649b7aa839783d551e8f328d..8c8d70832408fa4b05b19f64b541adb5957954d8 100644 (file)
 <!ENTITY insert.xref.page.number SYSTEM "../params/insert.xref.page.number.xml">
 <!ENTITY component.label.includes.part.label SYSTEM "../params/component.label.includes.part.label.xml">
 <!ENTITY simplesect.in.toc SYSTEM "../params/simplesect.in.toc.xml">
+<!ENTITY annotation.support SYSTEM "../params/annotation.support.xml">
+<!ENTITY annotation.js SYSTEM "../params/annotation.js.xml">
+<!ENTITY annotation.graphic.open SYSTEM "../params/annotation.graphic.open.xml">
+<!ENTITY annotation.graphic.close SYSTEM "../params/annotation.graphic.close.xml">
index be45c85df491d7f94272ef85eb014e4917c7ea23..f76fd26bd89433016d1711d7dee44cfd9c0daab6 100644 (file)
@@ -269,6 +269,13 @@ stylesheet like this:</para>
 &insert.xref.page.number;
 </reference>
 
+<reference><title>Annotations</title>
+&annotation.support;
+&annotation.js;
+&annotation.graphic.open;
+&annotation.graphic.close;
+</reference>
+
 <reference><title>Graphics</title>
 &img.src.path;
 &graphic.default.extension;
@@ -431,6 +438,10 @@ around all these parameters.</para>
 <src:fragref linkend="admon.style.frag"/>
 <src:fragref linkend="admon.textlabel.frag"/>
 <src:fragref linkend="annotate.toc.frag"/>
+<src:fragref linkend="annotation.js.frag"/>
+<src:fragref linkend="annotation.graphic.open.frag"/>
+<src:fragref linkend="annotation.graphic.close.frag"/>
+<src:fragref linkend="annotation.support.frag"/>
 <src:fragref linkend="appendix.autolabel.frag"/>
 <src:fragref linkend="author.othername.in.middle.frag"/>
 <src:fragref linkend="autotoc.label.separator.frag"/>
diff --git a/xsl/params/annotation.graphic.close.xml b/xsl/params/annotation.graphic.close.xml
new file mode 100644 (file)
index 0000000..1d86d45
--- /dev/null
@@ -0,0 +1,24 @@
+<refentry id="annotation.graphic.close">
+<refmeta>
+<refentrytitle>annotation.graphic.close</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>annotation.graphic.close</refname>
+<refpurpose>Enable annotations?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='annotation.graphic.close.frag'>
+<xsl:param name="annotation.graphic.close"
+   select="'http://docbook.sourceforge.net/release/images/annot-close.png'"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>This image is used on popup annotations as the “x” that the
+user can click to dismiss the popup.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/annotation.graphic.open.xml b/xsl/params/annotation.graphic.open.xml
new file mode 100644 (file)
index 0000000..82c8441
--- /dev/null
@@ -0,0 +1,24 @@
+<refentry id="annotation.graphic.open">
+<refmeta>
+<refentrytitle>annotation.graphic.open</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>annotation.graphic.open</refname>
+<refpurpose>Enable annotations?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='annotation.graphic.open.frag'>
+<xsl:param name="annotation.graphic.open"
+   select="'http://docbook.sourceforge.net/release/images/annot-open.png'"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>This image is used inline to identify the location of
+annotations.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/annotation.js.xml b/xsl/params/annotation.js.xml
new file mode 100644 (file)
index 0000000..fc53795
--- /dev/null
@@ -0,0 +1,27 @@
+<refentry id="annotation.js">
+<refmeta>
+<refentrytitle>annotation.js</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>annotation.js</refname>
+<refpurpose>Enable annotations?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='annotation.js.frag'>
+<xsl:param name="annotation.js"
+   select="'http://docbook.sourceforge.net/release/script/AnchorPosition.js
+            http://docbook.sourceforge.net/release/script/PopupWindow.js'"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If <property>annotation.support</property> is enabled and the
+document contains <sgmltag>annotation</sgmltag>s, then the URIs listed
+in this parameter will be included. These JavaScript files are required
+for popup annotation support.</para>
+
+</refsect1>
+</refentry>
diff --git a/xsl/params/annotation.support.xml b/xsl/params/annotation.support.xml
new file mode 100644 (file)
index 0000000..cbc27a8
--- /dev/null
@@ -0,0 +1,24 @@
+<refentry id="annotation.support">
+<refmeta>
+<refentrytitle>annotation.support</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>annotation.support</refname>
+<refpurpose>Enable annotations?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='annotation.support.frag'>
+<xsl:param name="annotation.support" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If non-zero, the stylesheets will attempt to support annotation
+elements in HTML by including some JavaScript (see
+<parameter>annotation.js</parameter>).</para>
+
+</refsect1>
+</refentry>