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] separating chapter labels and titles


Hi Jason,
For this customization, I would suggest customizing the 'component.title' template from xhtml/component.xsl. That template applies templates in mode="object.title.markup", which is the mechanism that uses the gentext template. Instead, use mode="label.markup" to generate the number, and mode="title.markup" to generate the title. If you do each of those inside their own <h1> element, you can add your separate class attributes. For the chapter number to say "Chapter", you will have to also call the template named 'gentext' as in the example below.

The component.title template is used by almost all direct children of book, though, so you might want to use an xsl:choose statement to apply this change only when local-name($node) = 'chapter', and use the default behavior otherwise.

...
<xsl:when test="local-name($node) = 'chapter'>
 <h1 class="chapter-label">
   <xsl:call-template name="gentext">
     <xsl:with-param name="key">chapter</xsl:with-param>
   </xsl:call-template>
   <xsl:text> </xsl:text>
   <xsl:apply-templates select="$node" mode="label.markup"/>
 </h1>
 <h1 class="title">
   <xsl:apply-templates select="$node" mode="title.markup"/>
 </h1>
</xsl:when>
...

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- From: "Jason Zech" <zech@loyolapress.com>
To: "DocBook Apps" <docbook-apps@lists.oasis-open.org>
Sent: Thursday, July 19, 2012 12:41 PM
Subject: [docbook-apps] separating chapter labels and titles


Hi all,

I am working with ns-1.77.1 stylesheets to transform to single and chunked xhtml. What I'd like to do is produce chapter autolabels (perhaps other components later) in a different tag from the chapter titles. Something like this:

<h1 class="chapter-label">Chapter 7</h1>
<h1 class="title">This Really Good Chapter Title</h1>

This would allow me a ton more flexibility using CSS to style my titlepages.

I've been tracing the long trip a chapter title makes through the stylesheets until my eyes are crossed and I can't figure out where I could separate these 2 elements (especially since they are grouped together in the gentext template).

Is this possible without a dramatic overhaul of the way titles are handled?

Thanks,

jz



---------------------------------------------------------------------
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]