diff --git a/packages/qwik-city/buildtime/markdown/mdx.ts b/packages/qwik-city/buildtime/markdown/mdx.ts index 8f59ea5addf..32de9d70351 100644 --- a/packages/qwik-city/buildtime/markdown/mdx.ts +++ b/packages/qwik-city/buildtime/markdown/mdx.ts @@ -26,24 +26,35 @@ export async function createMdxTransformer(ctx: BuildContext): Promise { diff --git a/packages/qwik-city/buildtime/types.ts b/packages/qwik-city/buildtime/types.ts index 2311117be2e..56b9c434b89 100644 --- a/packages/qwik-city/buildtime/types.ts +++ b/packages/qwik-city/buildtime/types.ts @@ -1,3 +1,9 @@ +import type { refractor } from 'refractor'; +import type { Options as RemarkGfmOptions } from 'remark-gfm'; +import type { Options as RehypeAutolinkHeadingsOptions } from 'rehype-autolink-headings'; + +type Refractor = typeof refractor; + export interface BuildContext { rootDir: string; opts: NormalizedPluginOptions; @@ -153,10 +159,14 @@ export interface PluginOptions { platform?: Record; } +export interface RehypeSyntaxHighlightOptions { + setup?: (refractor: Refractor) => void; +} + export interface MdxPlugins { - remarkGfm: boolean; - rehypeSyntaxHighlight: boolean; - rehypeAutolinkHeadings: boolean; + remarkGfm?: boolean | RemarkGfmOptions; + rehypeSyntaxHighlight?: boolean | RehypeSyntaxHighlightOptions; + rehypeAutolinkHeadings?: boolean | RehypeAutolinkHeadingsOptions; } export interface NormalizedPluginOptions extends Required {} diff --git a/packages/qwik-city/buildtime/vite/api.md b/packages/qwik-city/buildtime/vite/api.md index b82b9ecd19a..aaffd292de5 100644 --- a/packages/qwik-city/buildtime/vite/api.md +++ b/packages/qwik-city/buildtime/vite/api.md @@ -6,6 +6,9 @@ import { CompileOptions } from '@mdx-js/mdx/lib/compile'; import { ConfigEnv } from 'vite'; +import type { Options } from 'remark-gfm'; +import type { Options as Options_2 } from 'rehype-autolink-headings'; +import type { refractor } from 'refractor'; import { UserConfigExport } from 'vite'; // @public (undocumented)