Page 1 of 1

How to integrate syntax highlighting with PDF customization plugin?

Posted: Tue May 02, 2017 6:56 pm
by Frank Ralf
Hi,

The syntax highlighting DITA-OT plugin "com.oxygenxml.highlight" works like a charm when using the standard PDF transformation. However, we are using a customization DITA-OT plugin on top of the "org.dita.pdf2" plugin: <require plugin="org.dita.pdf2"/> but the syntax highlighting doesn't get through. From the above mentioned blog post I recognize that I probably have to use and/or reference those topic2fo_shell_xxx.xsl files. How do I do this? Any pointers welcome.

tia
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 03, 2017 2:02 am
by Radu
Hi Frank,

Not sure, if you send us the custom PDF plugin we could try to take a look at it. Possibly in your PDF plugin you added your own "topic2fo_shell" which instead of the original ones no longer defines extension points...
By the way, right now according to its licensing (see its plugin folder) this particular plugin is only free to use when publishing from Oxygen, otherwise when used outside you need to buy a separate webhelp license (even if you only need it for PDF).

Regards,
Radu

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 03, 2017 1:29 pm
by Frank Ralf
Hi Radu,

Thanks for the quick reply. I will have a closer look at our plugin and report back.

And yes, I've seen the licensing file in the plugin folder and will keep that in mind.

Best regards,
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 03, 2017 3:38 pm
by Frank Ralf
Hi Radu,

It was just a matter of adding the following line to our plugins/com.parson.pdf2/Customization/fo/xsl/custom.xsl file:

Code: Select all

<xsl:import href="../../../../com.oxygenxml.highlight/pdfHighlight.xsl"/>
Kind regards,
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 03, 2017 4:18 pm
by Frank Ralf
Just a follow-up question: Is it possible to overwrite the highlighter files in DITA-OT/plugins/com.oxygenxml.highlight/highlighters/ from within our customization plugin? If not, that's no problem as we distribute the whole DITA framework and could configure the highlighters in the Highlight plugin itself.

Best regards,
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 03, 2017 10:49 pm
by Radu
Hi Frank,

If you have a better idea about how we can make the plugin more extendable by customizers, we can try to improve it.
What do you mean by "highlighter files"? The XML configuration files for each programming language? The XSLT stylesheet "commons.xsl" seems to refer to them relative to the place where the 'commons.xsl' is placed.

Regards,
Radu

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Thu May 04, 2017 6:33 pm
by Frank Ralf
Hi Radu,

I mean configuring the color scheme(s). I will have a look and report back. Thanks for the pointers.

Best regards,
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Wed May 23, 2018 5:00 pm
by Frank Ralf
Hi Radu,

As a follow-up, we have a request for Matlab syntax highlighter. I've already started writing such a highlighter as a proof-of-concept. Should such a highlighter be provided as an addition to the oXygen plugin or better to the original Xslthl library? I've seen that you are currently working on a JSON highlighter there.

Best regards,
Frank

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Thu May 24, 2018 8:22 am
by Radu
Hi Frank,

So:
Should such a highlighter be provided as an addition to the oXygen plugin or better to the original Xslthl library?
It depends, if you want to go open source you can try to include your highlighter inside the Xslthl library. You can discuss this with Jirka Kosek who is one of the project's owners.
Or if you want to have your own closed source solution you can distribute your own Xslthl custom compiled project and maybe have a commercial DITA OT plugin which provides syntax highlight for Matlab.
I've seen that you are currently working on a JSON highlighter there.
I've kind of hacked a JSON highlighter by copying the Javascript highlighter XML rules and adding a new tag for the JSON key (because I wanted the JSON keys to have different colors although they are still plain quoted strings). I did not do something elegant but I kept changes to a minimum.

Regards,
Radu

Re: How to integrate syntax highlighting with PDF customization plugin?

Posted: Thu May 24, 2018 12:00 pm
by Frank Ralf
Hi Radu,

Thanks for your reply. As with you, we only took one of the existing XML configuration files and added some Matlab-specific keywords. So this can very well be open source. I will contact Jirka Kosek when we are finished.

Best regards,
Frank