Syntax Highlighting for reused code blocks
Posted: Thu Jan 04, 2018 11:49 am
Hello,
I have an API documentation with several reference topics for each API element (class, enum etc.). In the reference topic I use the codeblock element for this purpose. In the code block I use one ph to be able to reuse it.
However, I want to add one big code block to the appendix of the document that contains all the API elements. I did this with one reference topic and one codeblock that contains ph blocks that (conref) pull the content from other code blocks.
This works fine without syntax highlighting. When I enable syntax highlighting with the outputclass attribute, the resulting code is still not highlighted because it is nested in a ph element. Highlighting works fine when I remove the ph element but then conref does not work anymore...
Are there any solutions ideas on how to achieve code block reuse with syntax-highlighting?
Many Thanks
I have an API documentation with several reference topics for each API element (class, enum etc.). In the reference topic I use the codeblock element for this purpose. In the code block I use one ph to be able to reuse it.
Code: Select all
<codeblock outputclass="language-cpp"><ph id="code_reuse">
enumeration test
{
ONE
TWO
</ph>
</codeblock>
Code: Select all
<codeblock outputclass="language-cpp">
<ph conref="test.dita#reference_lxt_33z_dcb/code_reuse"/></ph>
</codeblock>
Are there any solutions ideas on how to achieve code block reuse with syntax-highlighting?
Many Thanks