mirror of
https://github.com/zap-proto/dev.git
synced 2026-10-30 15:05:18 +00:00
```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.
35 lines
939 B
TypeScript
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'],
|
|
},
|
|
});
|