[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Customizing procedure steps
Hi Bob, Thank you very much for your help! I managed to get it work for FO output with the customization below. However, this is not propagated to HTML, and when trying to customize the <xsl:template match="step"> template from html/lists.xsl, the stylesheet alwaya added a line-break after the gentext part. But it was the FO part that was more important, and that's working. Thanks again! Regards, Robert <xsl:template match="step" mode="number"> <xsl:param name="rest" select="''"/> <xsl:param name="recursive" select="1"/> <xsl:variable name="format"> <xsl:call-template name="procedure.step.numeration"/> </xsl:variable> <xsl:variable name="num"> <xsl:number count="step" format="{$format}"/> </xsl:variable> <!-- Inserted gentext call, probably not quite right --> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Step'"/> </xsl:call-template> <!-- Needed to have a space between Step and the number, not recognized in gentext for some reason --> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$recursive != 0 and ancestor::step"> <xsl:apply-templates select="ancestor::step[1]" mode="number"> <xsl:with-param name="rest" select="concat('.', $num, $rest)"/> </xsl:apply-templates> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat($num, $rest)"/> </xsl:otherwise> </xsl:choose> </xsl:template> Bob Stayton wrote: > Hi Robert, > No, you are not missing something obvious, it is harder than it should > be. Although there is a gentext entry for step in context="title", it > is not used by the stylesheets. Instead, the step number is generated > using its own template in common/common.xsl that starts with: > > <xsl:template match="step" mode="number"> > > You could add your own call to the gentext templates there. > > However, it also turns out that the indent for procedure steps is hard > coded in the template with match="procedure" in fo/lists.xsl: > > <fo:list-block xsl:use-attribute-sets="list.block.spacing" > provisional-distance-between-starts="2em" > provisional-label-separation="0.2em"> > > > So you will have to customize that template as well in order to change > the provisional-distance-between-starts property to make space for > "Step". That indent should be a parameter, as it is for other list > elements. > > Bob Stayton > Sagehill Enterprises > bobs@sagehill.net > > > ----- Original Message ----- From: "Robert Fekete" <frobert@balabit.com> > To: <docbook-apps@lists.oasis-open.org> > Sent: Thursday, April 15, 2010 12:57 AM > Subject: [docbook-apps] Customizing procedure steps > > >> Hi, >> >> I would like my procedure steps to start with "Step %n." instead of "%n." >> I thought this would be a simple gentext customization, but either >> it's more >> complicated, or I am missing something totally obvious. >> >> Any help is greatly appreciated. >> >> Regards, >> >> Robert Fekete >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >> >> >> > > > --------------------------------------------------------------------- > 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]