codeblock line numbers

Post here questions and problems related to editing and publishing DITA content.
jupiters1117
Posts: 1
Joined: Wed Jul 09, 2014 1:22 am

codeblock line numbers

Post by jupiters1117 »

Hi, is there a way to add line numbers for codeblock? Thank you.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: codeblock line numbers

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
asurkau
Posts: 6
Joined: Mon Mar 06, 2017 5:20 pm

Re: codeblock line numbers

Post 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.
Post Reply