codeblock line numbers

Posts: 1

codeblock line numbers

Wed Jul 09, 2014 1:28 am

Hi, is there a way to add line numbers for codeblock? Thank you.
Posts: 5757

Re: codeblock line numbers

Wed Jul 09, 2014 8:59 am


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?

Radu Coravu
<oXygen/> XML Editor
Posts: 6

Re: codeblock line numbers

Mon Sep 04, 2017 6:02 pm

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()"/>

If both values in this code are set to true, the pdf plugin will generate line numbers in code blocks.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest