Generate line numbers in codeblock elements

Automatically generate line numbers for <codeblock> elements.

It’s often helpful to include line numbers in <codeblock> elements so that you can refer to specific lines when explaining or describing the code. The PDF plugin now offers this capability. Line numbers would be useful in <msgblock> as well, but they are not currently available.

  1. Copy the following templates from DITA-OT/plugins/org.dita.pdf2/xsl/fo/pr-domain.xsl to your copy of pr-domain.xsl:
    <xsl:variable name="codeblock.wrap" select="false()"/>
    <xsl:template match="node()" mode="codeblock.generate-line-number" as="xs:boolean">
        <xsl:sequence select="false()"/>
    <xsl:template match="*[contains(@class,' pr-d/codeblock ...