Updated markdownOptions config type (#2826)

* Updated markdownOptions config type

* removed rehype-toc
This commit is contained in:
Rafid Muhymin Wafi 2022-03-23 21:47:43 +06:00 committed by GitHub
parent 715fab4faf
commit 52e75475ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -157,33 +157,41 @@ export interface AstroUserConfig {
/** @deprecated - Use "integrations" instead. Run Astro to learn more about migrating. */
renderers?: string[];
/**
* @docs
* @name markdownOptions
* @type {{render: MarkdownRenderOptions}}
* @see [Markdown guide](/en/guides/markdown-content/)
* @description
* Configure how markdown files (`.md`) are rendered.
*
* ```js
* {
* markdownOptions: {
* // Add a Remark plugin to your project.
* remarkPlugins: [
* ['remark-autolink-headings', { behavior: 'prepend'}],
* ],
* // Add a Rehype plugin to your project.
* rehypePlugins: [
* 'rehype-slug',
* ['rehype-autolink-headings', { behavior: 'prepend'}],
* ],
* // Customize syntax highlighting
* syntaxHighlight: 'shiki',
* },
* }
* ```
*/
/** Options for rendering markdown content */
/**
* @docs
* @name markdownOptions
* @type {{render: MarkdownRenderOptions}}
* @see [Markdown guide](/en/guides/markdown-content/)
* @description
* Configure how markdown files (`.md`) are rendered.
*
* ```js
* import { defineConfig } from "astro/config";
* import astroRemark from "@astrojs/markdown-remark";
* import customRehypePlugin from "/path/to/rehypePlugin.mjs";
*
* export default defineConfig({
* // Enable Custom Markdown options, plugins, etc.
* markdownOptions: {
* render: [
* // The Remark parser to parse Markdown content
* astroRemark,
* {
* // Add a Remark plugin to your project.
* remarkPlugins: ["remark-code-titles"],
*
* // Add a Rehype plugin to your project.
* rehypePlugins: [
* "rehype-slug",
* [customRehypePlugin, { configKey: "value" }],
* ["rehype-autolink-headings", { behavior: "prepend" }],
* ],
* },
* ],
* },
* });
* ```
*/
markdownOptions?: {
render?: MarkdownRenderOptions;
};