Page 1 of 1

Trying to add support for new output type for highlight plugin.

Posted: Wed Nov 15, 2023 6:48 pm
by easirois
Hi,
I'm trying to add support for a new output type for the syntax highlighting plugin but running into an issue getting the template to be executed and essentially, trying to emulate the PDF portion to support Miramo. I have started with copying the pdfHighlight.xsl as the basis of the customization.

The issue is with the use-when part. The same template definition is used in both cases. It works on the FO side, but not the Miramo side.
<xsl:template match="*[contains(@class,' pr-d/codeblock ')][contains(@outputclass, 'language-') or @outputclass=$allConfigHighlights]" use-when="function-available('version:getProductVersion') or function-available('oxy:highlight')">

Looking at the integration with the fop shell file I only see this: <xsl:import xmlns:dita="http://dita-ot.sourceforge.net" href="plugin:com.oxygenxml.highlight:pdfHighlight.xsl"/>. If I put that same reference in the Miramo shell, then the template above is not executed as well. If I remove the use-when bit from the template, then the template is executed.

So the big question is what am I missing with respect to the two functions? Where are they defined?

Re: Trying to add support for new output type for highlight plugin.

Posted: Wed Nov 15, 2023 7:14 pm
by easirois
I'm using a custom version of DITA OT 3.7.4. Trying to debug with editor 25.1.

Re: Trying to add support for new output type for highlight plugin.

Posted: Wed Nov 15, 2023 8:13 pm
by easirois
Looks looks like I found the issue.

In order for an <xslt> process in the Ant files to pick up the classpath information from the main build file it needs to be wrapped inside a pipeline element. Once that happens, then I'm getting the proper template called in the xslt.
<pipeline>
<xslt/>
</pipeline>

Re: Trying to add support for new output type for highlight plugin.

Posted: Thu Nov 16, 2023 11:03 am
by Radu
Hi Eric,
Right, thanks for posting the solution. By the way the "com.oxygenxml.highlight" plugin is not open source, so copying parts of it is Ok to help maybe a particular common customer for their internal needs but copies of its content should not be released in an open source plugin.
Regards,
Radu