@studiocms/md
Version:
Add Markdown Support to your StudioCMS project with ease!
34 lines (33 loc) • 1.64 kB
TypeScript
/**
* These triple-slash directives defines dependencies to various declaration files that will be
* loaded when a user imports the StudioCMS plugin in their Astro configuration file. These
* directives must be first at the top of the file and can only be preceded by this comment.
*/
/// <reference types="./virtual.d.ts" preserve="true" />
import type { AstroIntegration } from 'astro';
import { type StudioCMSPlugin } from 'studiocms/plugins';
import { type MarkdownSchemaOptions } from './types.js';
export declare function internalMarkdownIntegration(options?: MarkdownSchemaOptions): AstroIntegration;
/**
* Creates a StudioCMS plugin for Markdown page types.
*
* This plugin configures StudioCMS to support Markdown content, including rendering and editing components,
* integration with Astro, and optional callout themes. It resolves user-provided options, sets up virtual imports,
* and injects necessary styles and scripts for Markdown rendering.
*
* @param options - Optional configuration for Markdown schema and rendering behavior.
* @returns A StudioCMSPlugin instance configured for Markdown support.
*
* @remarks
* - Supports custom callout themes if enabled in options.
* - Integrates with Astro via virtual imports and injected scripts.
* - Stores resolved options and Astro markdown configuration in shared context.
*
* @example
* ```typescript
* import { studiocmsMD } from '@studiocms/md';
* const plugin = studiocmsMD({ flavor: 'studiocms', callouts: 'obsidian' });
* ```
*/
export declare function studiocmsMD(options?: MarkdownSchemaOptions): StudioCMSPlugin;
export default studiocmsMD;