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: is there a way to search the commit stream?


Okay, here is the (hacked) code to create a "Caption: " in front of
the first para within a caption. Note that I haven't yet written a
gentext for it, so it isn't easy to internationalize. If you're
wondering why I didn't make the font bold for html, it is because the
figure title fonts aren't any larger (at least on my system) than the
caption font. In that case, making the Caption tag bold would be
visually confusing. However, the bold tag works out well in fo.

for fo:
	<xsl:template match="caption/para">
		<xsl:choose>
			<xsl:when test="count(preceding-sibling::*)=0">
				<fo:block xsl:use-attribute-sets="normal.para.spacing">
					<xsl:call-template name="anchor"/>
					<fo:inline font-weight="bold">Caption: </fo:inline>
					<xsl:apply-templates/>
				</fo:block>
			</xsl:when>
			<xsl:otherwise>
				<fo:block xsl:use-attribute-sets="normal.para.spacing">
					<xsl:call-template name="anchor"/>
					<xsl:apply-templates/>
				</fo:block>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

for html:
	<xsl:template match="caption/para">
		<xsl:choose>
			<xsl:when test="count(preceding-sibling::*)=0">
				<xsl:call-template name="captionparagraph">
					<xsl:with-param name="class">
						<xsl:if test="@role and $para.propagates.style != 0">
							<xsl:value-of select="@role"/>
						</xsl:if>
					</xsl:with-param>
					<xsl:with-param name="content">
						<xsl:if test="position() = 1 and parent::listitem">
							<xsl:call-template name="anchor">
								<xsl:with-param name="node" select="parent::listitem"/>
							</xsl:call-template>
						</xsl:if>
						<xsl:call-template name="anchor"/>
						<xsl:apply-templates/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:call-template name="$paragraph">
					<xsl:with-param name="class">
						<xsl:if test="@role and $para.propagates.style != 0">
							<xsl:value-of select="@role"/>
						</xsl:if>
					</xsl:with-param>
					<xsl:with-param name="content">
						<xsl:if test="position() = 1 and parent::listitem">
							<xsl:call-template name="anchor">
								<xsl:with-param name="node" select="parent::listitem"/>
							</xsl:call-template>
						</xsl:if>
						<xsl:call-template name="anchor"/>
						<xsl:apply-templates/>
					</xsl:with-param>
				</xsl:call-template>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="captionparagraph">
		<xsl:param name="class" select="''"/>
		<xsl:param name="content"/>
		
		<xsl:variable name="p">
			<p>
				<xsl:call-template name="dir"/>
				<xsl:if test="$class != ''">
					<xsl:attribute name="class">
						<xsl:value-of select="$class"/>
					</xsl:attribute>
				</xsl:if>
				<xsl:text>Caption: </xsl:text>
				<xsl:copy-of select="$content"/>
			</p>
		</xsl:variable>
		
		<xsl:choose>
			<xsl:when test="$html.cleanup != 0">
				<xsl:call-template name="unwrap.p">
					<xsl:with-param name="p" select="$p"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:copy-of select="$p"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>



On 10/18/06, Chris Chiasson <chris@chiasson.name> wrote:
> Now that I am looking into it, making a caption generate a label that
> is inline can be tricky since caption doesn't have to be just one
> phrase or para...
>
> On 10/18/06, Chris Chiasson <chris@chiasson.name> wrote:
> <snip/>
>
> --
> http://chris.chiasson.name/
>


-- 
http://chris.chiasson.name/


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