Redocly / developer-portal-starter

Starter template for the Redocly developer portal
https://redoc.ly
Other
64 stars 101 forks source link

Can we add more syntax highlighting options? #251

Open jstuckey opened 11 months ago

jstuckey commented 11 months ago

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 commented 11 months ago

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.

adamaltman commented 11 months ago

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

jstuckey commented 10 months ago

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