Updated markdownOptions config type (#2826)
* Updated markdownOptions config type * removed rehype-toc
This commit is contained in:
parent
715fab4faf
commit
52e75475ae
1 changed files with 35 additions and 27 deletions
|
@ -157,33 +157,41 @@ export interface AstroUserConfig {
|
||||||
/** @deprecated - Use "integrations" instead. Run Astro to learn more about migrating. */
|
/** @deprecated - Use "integrations" instead. Run Astro to learn more about migrating. */
|
||||||
renderers?: string[];
|
renderers?: string[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @docs
|
* @docs
|
||||||
* @name markdownOptions
|
* @name markdownOptions
|
||||||
* @type {{render: MarkdownRenderOptions}}
|
* @type {{render: MarkdownRenderOptions}}
|
||||||
* @see [Markdown guide](/en/guides/markdown-content/)
|
* @see [Markdown guide](/en/guides/markdown-content/)
|
||||||
* @description
|
* @description
|
||||||
* Configure how markdown files (`.md`) are rendered.
|
* Configure how markdown files (`.md`) are rendered.
|
||||||
*
|
*
|
||||||
* ```js
|
* ```js
|
||||||
* {
|
* import { defineConfig } from "astro/config";
|
||||||
* markdownOptions: {
|
* import astroRemark from "@astrojs/markdown-remark";
|
||||||
* // Add a Remark plugin to your project.
|
* import customRehypePlugin from "/path/to/rehypePlugin.mjs";
|
||||||
* remarkPlugins: [
|
*
|
||||||
* ['remark-autolink-headings', { behavior: 'prepend'}],
|
* export default defineConfig({
|
||||||
* ],
|
* // Enable Custom Markdown options, plugins, etc.
|
||||||
* // Add a Rehype plugin to your project.
|
* markdownOptions: {
|
||||||
* rehypePlugins: [
|
* render: [
|
||||||
* 'rehype-slug',
|
* // The Remark parser to parse Markdown content
|
||||||
* ['rehype-autolink-headings', { behavior: 'prepend'}],
|
* astroRemark,
|
||||||
* ],
|
* {
|
||||||
* // Customize syntax highlighting
|
* // Add a Remark plugin to your project.
|
||||||
* syntaxHighlight: 'shiki',
|
* remarkPlugins: ["remark-code-titles"],
|
||||||
* },
|
*
|
||||||
* }
|
* // Add a Rehype plugin to your project.
|
||||||
* ```
|
* rehypePlugins: [
|
||||||
*/
|
* "rehype-slug",
|
||||||
/** Options for rendering markdown content */
|
* [customRehypePlugin, { configKey: "value" }],
|
||||||
|
* ["rehype-autolink-headings", { behavior: "prepend" }],
|
||||||
|
* ],
|
||||||
|
* },
|
||||||
|
* ],
|
||||||
|
* },
|
||||||
|
* });
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
markdownOptions?: {
|
markdownOptions?: {
|
||||||
render?: MarkdownRenderOptions;
|
render?: MarkdownRenderOptions;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue