Page 1 of 1

codeblock line numbers

Posted: Wed Jul 09, 2014 1:28 am
by jupiters1117
Hi, is there a way to add line numbers for codeblock? Thank you.

Re: codeblock line numbers

Posted: Wed Jul 09, 2014 8:59 am
by Radu
Hi,

This is not available right now.
Do you want this for publishing or for editing the codeblock sections?
If you want this for publishing, do you want this for the PDF or for the XHTML-based outputs?

Regards,
Radu

Re: codeblock line numbers

Posted: Mon Sep 04, 2017 6:02 pm
by asurkau
Hi, it is now possible to add line numbers in code blocks.

DITA OT 2.3.3 and higher has the following code in pr-domain.xsl -

Code: Select all

<xsl:variable name="codeblock.wrap" select="true()"/>
<xsl:template match="node()" mode="codeblock.generate-line-number" as="xs:boolean">
<xsl:sequence select="true()"/>
</xsl:template>
If both values in this code are set to true, the pdf plugin will generate line numbers in code blocks.