OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Appendix Titles


Hi Aiden,
Actually, there is an easier way to do it.  The title.markup mode is used
almost everywhere a title generated.  So you could customize that mode for
appendix.  The original is a template with match="preface|chapter|appendix"
mode="title.markup" in common/titles.xsl.  You could add this customization
template for just appendix:

<xsl:template match="appendix" mode="title.markup">
  <xsl:param name="allow-anchors" select="0"/>

  <xsl:variable name="title" select="(info/title
                                      |appendixinfo/title
                                      |title)[1]"/>

  <xsl:call-template name="gentext">
    <xsl:with-param name="key" select="'Appendix'"/>
  </xsl:call-template>
  <xsl:text> </xsl:text>

  <xsl:apply-templates select="$title" mode="title.markup">
    <xsl:with-param name="allow-anchors" select="$allow-anchors"/>
  </xsl:apply-templates>
</xsl:template>

I think this handles all your cases.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Aidan Lister" <aidanis@gmail.com>
To: <docbook-apps@lists.oasis-open.org>
Sent: Tuesday, June 28, 2005 6:49 PM
Subject: [docbook-apps] Appendix Titles


Hello list,

I'm trying to add the word "Appendix" before any Appendix Title.

This occurs in three places.
1) Table of contents
2) <title> of appendix
3) Main text of appendix

I've solved 1 and 2 using the below modifications,

<!-- Adds "Appendix" to appendices -->
<xsl:template name="head.content">
  ...
  <title>
    <!-- Added this -->
    <xsl:if test="local-name(.) = 'appendix'">
       <xsl:call-template name="gentext">
         <xsl:with-param name="key" select="'Appendix'"/>
       </xsl:call-template>
       <xsl:text> </xsl:text>
    </xsl:if>

    <xsl:copy-of select="$title"/>
  </title>
  ...
</xsl:template>

<!-- Add "Appendix" to appendices listing in TOC -->
<xsl:template name="toc.line">
  ...

  <span>
  <xsl:attribute name="class"><xsl:value-of
select="local-name(.)"/></xsl:attribute>
  <a>
    ...
    <!-- Added this -->
    <xsl:choose>
      <xsl:when test="self::appendix">
        <xsl:call-template name="gentext">
          <xsl:with-param name="key" select="'Appendix'"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
      </xsl:when>
    </xsl:choose>
    ...
  </a>
  </span>
</xsl:template>

However I'm unable to solve number 3.

If anyone knows how to add this, that would be great. Better yet, is
there a better way to do it?

Kind regards,
Aidan

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]