How to integrate syntax highlighting with PDF customization plugin?

Frank Ralf
Posts: 365
Location: Hamburg

How to integrate syntax highlighting with PDF customization plugin?

Tue May 02, 2017 6:56 pm

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
Frank Ralf
parson AG
www.parson-europe.com
Radu
Posts: 5585

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

Wed May 03, 2017 2:02 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Wed May 03, 2017 1:29 pm

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
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Wed May 03, 2017 3:38 pm

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
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Wed May 03, 2017 4:18 pm

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
Frank Ralf
parson AG
www.parson-europe.com
Radu
Posts: 5585

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

Wed May 03, 2017 10:49 pm

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Thu May 04, 2017 6:33 pm

Hi Radu,

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

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Wed May 23, 2018 5:00 pm

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
Frank Ralf
parson AG
www.parson-europe.com
Radu
Posts: 5585

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

Thu May 24, 2018 8:22 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Frank Ralf
Posts: 365
Location: Hamburg

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

Thu May 24, 2018 12:00 pm

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
Frank Ralf
parson AG
www.parson-europe.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 0 guests