Syntax Formatting for codeblocks in AEM Output | Community
Skip to main content
June 12, 2020

Syntax Formatting for codeblocks in AEM Output

  • June 12, 2020
  • 1 reply
  • 1419 views

I am using AEM assets to create documentation. I have a document with a lot of codeblocks. Is there any way to do syntax highlighting of code?

 

I tried using the outputclass attribute for the codeblock, but that did not seem to do anything.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Adobe Employee
October 20, 2020

Could you note use the Text Core Component, create a "Code" paragraph style in the Policy (that wraps with the <code>), and then have your favorite JS-based code highlighter target `.cmp_text code` ?

 

https://docs.adobe.com/content/help/en/experience-manager-core-components/using/components/text.html