Customize Syntax Highlighting colors

Questions about XML that are not covered by the other forums should go here.
daryl
Posts: 11
Joined: Thu Feb 11, 2021 9:22 pm

Customize Syntax Highlighting colors

Post by daryl »

Hi,

Is it possible to customize syntax highlight colors in a codeblock in a Webhelp Responsive Output?

Thanks.
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Customize Syntax Highlighting colors

Post by Costin »

Hi Daryl,

There is predefined support for syntax-highlight for codeblocks, so, depending on the value of the outputclass attribute set for each specific codeblock to specify the code/languaget, the corresponding syntax-higlight coloring scheme would be applied over the codeblock's content. You can find more details in the Adding Syntax Highlights for Codeblocks in the Output section from the Oxygen XML Editor User-Guide.
This applies also for WebHelp, so I've just asked our documentation team to include that topic also in the WebHelp Responsive User-Guide.

However, there is no out-of-the-box support for customizing the syntax highlight colors.
You could most probably customize the colors using your own CSS customization.
You can find more details on how to use the internet browser's CSS inspector to identify the specific elements which your CSS rules could match and how to customize your output using CSS in this section from the WebHelp Responsive user-guide.

For an example of setting syntax-highlight colors through CSS, you should take a look at the the "syntax-highlight.css" predefined CSS, available in: [DITA_OT_DIR]/plugins/com.oxygenxml.webhelp.responsive/oxygen-webhelp/app/topic/syntax-highlight.css

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Frank Ralf
Posts: 460
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Customize Syntax Highlighting colors

Post by Frank Ralf »

Hi Daryl,

The syntax highlighting is implemented in the proprietary Oxygen DITA-OT plugin com.oxygenxml.highlight which is based on the open source XSLT syntax highlighting for which the documentation can be found at https://sourceforge.net/p/xslthl/wiki/Home/.

For additional background information see https://blog.oxygenxml.com/topics/creat ... olkit.html.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
marvinmartin
Posts: 1
Joined: Thu Nov 02, 2023 1:37 pm

Re: Customize Syntax Highlighting colors

Post by marvinmartin »

Frank Ralf wrote: Fri Sep 29, 2023 1:05 pm Hi Daryl,

The syntax highlighting is implemented in the proprietary Oxygen DITA-OT plugin com.oxygenxml.highlight which is based on the open source XSLT syntax highlighting for which the documentation can be found at https://sourceforge.net/p/xslthl/wiki/Home/geometry dash subzero.

For additional background information see https://blog.oxygenxml.com/topics/creat ... olkit.html.

Best regards,
Frank
Can you provide me with the specific documentation and resources for the Oxygen DITA-OT plugin?
Costin
Posts: 833
Joined: Mon Dec 05, 2011 6:04 pm

Re: Customize Syntax Highlighting colors

Post by Costin »

Hi,

There is no out-of-the-box documentation for various customizations, but it is possible to customize the WebHelp output (including the colors for different elements) through a CSS customization.
You can find more information on how you could use the CSS Inspector from your internet browser to inspect the output and identify the elements (classes) you should match through CSS rules, as well as how to create and use your own CSS customization, in this section from the Oxygen XML WebHelp User-Guide.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
Frank Ralf
Posts: 460
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Customize Syntax Highlighting colors

Post by Frank Ralf »

Hi Costin,

Thanks for that pointer. I had not thought about just overriding the CSS for the syntax highlighting. That sounds much easier than modifying the plugin.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply