Files
dev/source.config.ts
zeekay b5c52729a0 docs: register ZAP TextMate grammar with Shiki to fix ShikiError
```zap fences in rpc/schema/sdks were throwing
'ShikiError: Language zap is not included in this bundle' at render,
turning the static export RED. Vendor ZAP's TextMate grammar (source.zap)
from luxfi zap/syntax and pass it to Shiki via the docs-mdx preset's
rehypeCodeOptions.langs. capnp needs no handling — SchemaTabs highlights
it itself; no capnp fences exist.

Build: pnpm build -> exit 0, 44/44 static pages, zap keywords highlighted.
2026-06-21 08:18:33 -07:00

35 lines
939 B
TypeScript

import {
defineConfig,
defineDocs,
frontmatterSchema,
metaSchema,
type DefaultMDXOptions,
} from '@hanzo/docs-mdx/config';
import zapGrammar from './lib/zap.tmLanguage.json';
export const docs = defineDocs({
dir: 'content/docs',
docs: {
schema: frontmatterSchema,
postprocess: {
includeProcessedMarkdown: true,
},
},
meta: {
schema: metaSchema,
},
});
export default defineConfig({
mdxOptions: {
// Register ZAP's TextMate grammar so ```zap fences highlight instead of
// throwing ShikiError. Grammar vendored from luxfi zap/syntax (source.zap).
// Only `langs` is overridden; themes/engine/transformers stay on the docs
// preset defaults, which the runtime merges in (its type demands a full
// options object, so this partial override is asserted).
rehypeCodeOptions: {
langs: [zapGrammar],
} as unknown as DefaultMDXOptions['rehypeCodeOptions'],
},
});