UNPKG

@mintlify/validation

Version:

Validates mint.json files

41 lines (40 loc) 1.49 kB
import { SHIKI_THEMES } from '@mintlify/mdx/constants'; import { z } from 'zod'; const codeblockCustomLanguagesSchema = z .object({ custom: z .array(z .string() .describe('Path (absolute or relative) to a JSON file describing a custom Shiki language')) .optional(), }) .describe('Custom language configuration for codeblocks'); export const stylingSchema = z .object({ eyebrows: z .enum(['section', 'breadcrumbs']) .optional() .describe('The eyebrows style of the content. Defaults to `section`.'), codeblocks: z .union([ z.enum(['system', 'dark']).optional(), z.object({ theme: z .union([ z.enum(SHIKI_THEMES), z.object({ light: z.enum(SHIKI_THEMES), dark: z.enum(SHIKI_THEMES), }), ]) .optional(), languages: codeblockCustomLanguagesSchema.optional(), }), ]) .describe('The codeblock theme configuration. Defaults to `system`. To use a built-in shiki theme, add the theme name as "theme" in the object. To use different shiki themes for light and dark modes, add "themes" in the object with "dark" and "light" keys.'), latex: z .boolean() .optional() .describe('Whether to include latex styling, overriding our default latex detection'), }) .describe('Styling configurations');