Page 1 of 1

Customize Syntax Highlighting colors

Posted: Fri Feb 19, 2021 9:09 pm
by daryl
Hi,

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

Thanks.

Re: Customize Syntax Highlighting colors

Posted: Wed Feb 24, 2021 1:33 pm
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

Re: Customize Syntax Highlighting colors

Posted: Fri Sep 29, 2023 1:05 pm
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

Re: Customize Syntax Highlighting colors

Posted: Thu Nov 02, 2023 1:53 pm
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?

Re: Customize Syntax Highlighting colors

Posted: Mon Nov 06, 2023 12:07 pm
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

Re: Customize Syntax Highlighting colors

Posted: Mon Nov 06, 2023 12:24 pm
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