Skip to content

Register syntax-highlighting languages used in docs code blocks#1046

Open
ntotten wants to merge 1 commit into
mainfrom
claude/syntax-highlighting-languages
Open

Register syntax-highlighting languages used in docs code blocks#1046
ntotten wants to merge 1 commit into
mainfrom
claude/syntax-highlighting-languages

Conversation

@ntotten
Copy link
Copy Markdown
Member

@ntotten ntotten commented May 29, 2026

Problem

Rendering docs pages logged a stream of warnings and fell back to plain text for many code blocks:

Language "csharp" is not loaded for syntax highlighting. Add it to `syntaxHighlighting.languages` in your config. Falling back to plain text.
Language "rust" is not loaded ...
Language "php" is not loaded ...
...

Zudoku only loads a small default set of languages for Shiki. Anything outside it (the SDK/code-sample languages used across the docs) wasn't highlighted.

Fix

Set syntaxHighlighting.languages in zudoku.config.tsx.

⚠️ Providing this list replaces Zudoku's defaults (const languages = config.syntaxHighlighting?.languages ?? defaultLanguages), so the defaults (shellscript, javascript, typescript, json, yaml, python, java, go, etc.) are re-listed alongside the additions to avoid regressing currently-working highlighting.

The added languages were gathered by scanning every code fence in docs/, so this covers more than just the warnings reported (e.g. http, toml, sql, lua are used in the docs and would warn too). ansi and velocity are used but aren't loadable Shiki grammars, so they're intentionally left as plain text.

Verification

Rendered the Zudoku syntax-highlight demo page (which exercises all these languages) in the local dev server:

  • Zero "is not loaded for syntax highlighting" warnings in the server log (previously one per language).
  • ✅ Every target language now renders with full Shiki token highlighting — confirmed via the DOM (e.g. csharp 50 token spans, rust 47, cpp 68, zig 75, swift 40, kotlin 50, php 37, ruby 29, scala 63, dart 75, elixir 64, ocaml 56, lisp 42, objc 50, powershell 63) — none falling back to plain text.
  • typecheck, prettier --check, guides:check, and lint:admonitions all pass.

🤖 Generated with Claude Code

Code blocks tagged with languages like csharp, rust, php, swift, kotlin,
ruby, c/cpp, scala, dart, elixir, and others were logging "Language X is
not loaded for syntax highlighting" and falling back to plain text.

Set `syntaxHighlighting.languages` to register them. Because providing this
list replaces Zudoku's default set, the defaults are re-listed alongside the
additional languages used across the docs (gathered by scanning every code
fence in docs/).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 29, 2026 8:41pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant