Syntax Highlighting for reused code blocks

Post here questions and problems related to editing and publishing DITA content.
Dael
Posts: 1
Joined: Thu Jan 04, 2018 11:36 am

Syntax Highlighting for reused code blocks

Post by Dael »

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.

Code: Select all


<codeblock outputclass="language-cpp"><ph id="code_reuse">
enumeration test
{
ONE
TWO
</ph>
</codeblock>
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.

Code: Select all


<codeblock outputclass="language-cpp">
<ph conref="test.dita#reference_lxt_33z_dcb/code_reuse"/></ph>
</codeblock>
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
Radu
Posts: 9444
Joined: Fri Jul 09, 2004 5:18 pm

Re: Syntax Highlighting for reused code blocks

Post by Radu »

Hi,

We might be able to fix this problem in the XSLT stylesheets we developed to perform the syntax highlight, I will add an internal issue to look further into this.
If you want to test a possible fix you can contact us directly via email (support@oxygenxml.com) and I can try to give you some steps to add the fix on your side.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9444
Joined: Fri Jul 09, 2004 5:18 pm

Re: Syntax Highlighting for reused code blocks

Post by Radu »

Hi,

Just to update this thread, Oxygen XML Editor version 20 should have a fix for this.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply