developer-portal-starter icon indicating copy to clipboard operation
developer-portal-starter copied to clipboard

Can we add more syntax highlighting options?

Open jstuckey opened this issue 2 years ago • 3 comments
trafficstars

The portal is using highlight.js for syntax highlighting code blocks in markdown. highlight.js supports adding third-party languages, but are we able to use that feature in the portal? I was hoping to add syntax highlighting for curl code blocks.

jstuckey avatar Jul 27 '23 19:07 jstuckey

I experimented a bit using the scripts siteConfig option, but no luck. I need to run a script similar to this:

var hljs = require('highlight.js');
var hljsCurl = require('highlightjs-curl');

hljs.registerLanguage("curl", hljsCurl);

The issue is highlight.js is not available. I looked through the sources tab in dev tools, and it looks like highlight.js is not included.

jstuckey avatar Jul 31 '23 14:07 jstuckey

The portal is using prismjs for syntax highlighting code blocks in Markdown with these supported languages: https://prismjs.com/#supported-languages

adamaltman avatar Aug 03 '23 18:08 adamaltman

Ah, thank you @adamaltman. Should this documentation be updated? https://redocly.com/docs/developer-portal/guides/markdown/#built-with

jstuckey avatar Aug 17 '23 13:08 jstuckey