types
Type Aliases
Section titled “Type Aliases”AstroMarkdownOptions
Section titled “AstroMarkdownOptions”type AstroMarkdownOptions = { flavor: "astro"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };};
Defined in: studiocms/packages/@studiocms/md/src/types.ts:82^
Schema definition for Astro-flavored Markdown content.
Type Declaration
Section titled “Type Declaration”flavor
Section titled “flavor”flavor: "astro";
Specifies the Markdown flavor, fixed to ‘astro’. This property is used to differentiate between different Markdown configurations.
sanitize?
Section titled “sanitize?”optional sanitize: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[];} = StudioCMSSanitizeOptionsSchema;
Schema for options used to sanitize Markdown content in StudioCMS.
Remarks
Section titled “Remarks”This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.
sanitize.allowAttributes?
Section titled “sanitize.allowAttributes?”optional allowAttributes: Record<string, string[]>;
sanitize.allowComments?
Section titled “sanitize.allowComments?”optional allowComments: boolean;
sanitize.allowComponents?
Section titled “sanitize.allowComponents?”optional allowComponents: boolean;
sanitize.allowCustomElements?
Section titled “sanitize.allowCustomElements?”optional allowCustomElements: boolean;
sanitize.allowElements?
Section titled “sanitize.allowElements?”optional allowElements: string[];
sanitize.blockElements?
Section titled “sanitize.blockElements?”optional blockElements: string[];
sanitize.dropAttributes?
Section titled “sanitize.dropAttributes?”optional dropAttributes: Record<string, string[]>;
sanitize.dropElements?
Section titled “sanitize.dropElements?”optional dropElements: string[];
Remarks
Section titled “Remarks”This schema is used to validate Markdown objects that are specifically
intended for use with the Astro flavor. It ensures that the flavor
property is set to 'astro'
and that the sanitize
property conforms
to the StudioCMSSanitizeOptionsSchema
.
MarkdownSchemaOptions
Section titled “MarkdownSchemaOptions”type MarkdownSchemaOptions = | { flavor: "astro"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };} | { autoLinkHeadings: boolean; callouts: false | "github" | "obsidian" | "vitepress"; discordSubtext: boolean; flavor: "studiocms"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };};
Defined in: studiocms/packages/@studiocms/md/src/types.ts:84^
Defines a Zod schema for Markdown content, allowing either AstroMarkdownSchema
or StudioCMSMarkdownSchema
.
The schema is optional and defaults to an object with the flavor set to ‘studiocms’.
Type Declaration
Section titled “Type Declaration”{ flavor: "astro"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };}
flavor
Section titled “flavor”flavor: "astro";
Specifies the Markdown flavor, fixed to ‘astro’. This property is used to differentiate between different Markdown configurations.
sanitize?
Section titled “sanitize?”optional sanitize: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[];} = StudioCMSSanitizeOptionsSchema;
Schema for options used to sanitize Markdown content in StudioCMS.
Remarks
Section titled “Remarks”This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.
sanitize.allowAttributes?
Section titled “sanitize.allowAttributes?”optional allowAttributes: Record<string, string[]>;
sanitize.allowComments?
Section titled “sanitize.allowComments?”optional allowComments: boolean;
sanitize.allowComponents?
Section titled “sanitize.allowComponents?”optional allowComponents: boolean;
sanitize.allowCustomElements?
Section titled “sanitize.allowCustomElements?”optional allowCustomElements: boolean;
sanitize.allowElements?
Section titled “sanitize.allowElements?”optional allowElements: string[];
sanitize.blockElements?
Section titled “sanitize.blockElements?”optional blockElements: string[];
sanitize.dropAttributes?
Section titled “sanitize.dropAttributes?”optional dropAttributes: Record<string, string[]>;
sanitize.dropElements?
Section titled “sanitize.dropElements?”optional dropElements: string[];
{ autoLinkHeadings: boolean; callouts: false | "github" | "obsidian" | "vitepress"; discordSubtext: boolean; flavor: "studiocms"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };}
autoLinkHeadings
Section titled “autoLinkHeadings”autoLinkHeadings: boolean;
Optionally enables automatic linking of headings, defaults to true. This property allows users to automatically create links for headings in Markdown content.
callouts
Section titled “callouts”callouts: false | "github" | "obsidian" | "vitepress";
Optional callouts style, defaults to ‘obsidian’. This property allows users to choose a specific callout theme for Markdown content.
discordSubtext
Section titled “discordSubtext”discordSubtext: boolean;
Optionally enables Discord subtext, defaults to true. This property allows users to include Discord-style subtext in Markdown content.
flavor
Section titled “flavor”flavor: "studiocms";
Specifies the markdown flavor, fixed to ‘studiocms’. This property is used to differentiate between different Markdown configurations.
sanitize?
Section titled “sanitize?”optional sanitize: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[];} = StudioCMSSanitizeOptionsSchema;
Schema for options used to sanitize Markdown content in StudioCMS.
Remarks
Section titled “Remarks”This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.
sanitize.allowAttributes?
Section titled “sanitize.allowAttributes?”optional allowAttributes: Record<string, string[]>;
sanitize.allowComments?
Section titled “sanitize.allowComments?”optional allowComments: boolean;
sanitize.allowComponents?
Section titled “sanitize.allowComponents?”optional allowComponents: boolean;
sanitize.allowCustomElements?
Section titled “sanitize.allowCustomElements?”optional allowCustomElements: boolean;
sanitize.allowElements?
Section titled “sanitize.allowElements?”optional allowElements: string[];
sanitize.blockElements?
Section titled “sanitize.blockElements?”optional blockElements: string[];
sanitize.dropAttributes?
Section titled “sanitize.dropAttributes?”optional dropAttributes: Record<string, string[]>;
sanitize.dropElements?
Section titled “sanitize.dropElements?”optional dropElements: string[];
Remarks
Section titled “Remarks”This schema is useful for validating Markdown data that may conform to different formats, providing flexibility in content handling within the application.
StudioCMSMarkdownOptions
Section titled “StudioCMSMarkdownOptions”type StudioCMSMarkdownOptions = { autoLinkHeadings: boolean; callouts: false | "github" | "obsidian" | "vitepress"; discordSubtext: boolean; flavor: "studiocms"; sanitize?: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[]; };};
Defined in: studiocms/packages/@studiocms/md/src/types.ts:83^
Schema definition for StudioCMS Markdown configuration.
Type Declaration
Section titled “Type Declaration”autoLinkHeadings
Section titled “autoLinkHeadings”autoLinkHeadings: boolean;
Optionally enables automatic linking of headings, defaults to true. This property allows users to automatically create links for headings in Markdown content.
callouts
Section titled “callouts”callouts: false | "github" | "obsidian" | "vitepress";
Optional callouts style, defaults to ‘obsidian’. This property allows users to choose a specific callout theme for Markdown content.
discordSubtext
Section titled “discordSubtext”discordSubtext: boolean;
Optionally enables Discord subtext, defaults to true. This property allows users to include Discord-style subtext in Markdown content.
flavor
Section titled “flavor”flavor: "studiocms";
Specifies the markdown flavor, fixed to ‘studiocms’. This property is used to differentiate between different Markdown configurations.
sanitize?
Section titled “sanitize?”optional sanitize: { allowAttributes?: Record<string, string[]>; allowComments?: boolean; allowComponents?: boolean; allowCustomElements?: boolean; allowElements?: string[]; blockElements?: string[]; dropAttributes?: Record<string, string[]>; dropElements?: string[];} = StudioCMSSanitizeOptionsSchema;
Schema for options used to sanitize Markdown content in StudioCMS.
Remarks
Section titled “Remarks”This schema defines the configuration for controlling which elements and attributes are allowed, blocked, or dropped during the sanitization process. It also provides options for handling components, custom elements, and comments.
sanitize.allowAttributes?
Section titled “sanitize.allowAttributes?”optional allowAttributes: Record<string, string[]>;
sanitize.allowComments?
Section titled “sanitize.allowComments?”optional allowComments: boolean;
sanitize.allowComponents?
Section titled “sanitize.allowComponents?”optional allowComponents: boolean;
sanitize.allowCustomElements?
Section titled “sanitize.allowCustomElements?”optional allowCustomElements: boolean;
sanitize.allowElements?
Section titled “sanitize.allowElements?”optional allowElements: string[];
sanitize.blockElements?
Section titled “sanitize.blockElements?”optional blockElements: string[];
sanitize.dropAttributes?
Section titled “sanitize.dropAttributes?”optional dropAttributes: Record<string, string[]>;
sanitize.dropElements?
Section titled “sanitize.dropElements?”optional dropElements: string[];
Variables
Section titled “Variables”AstroMarkdownSchema
Section titled “AstroMarkdownSchema”const AstroMarkdownSchema: ZodObject<AstroMarkdownOptions>;
Defined in: studiocms/packages/@studiocms/md/src/types.ts:17^
Schema definition for Astro-flavored Markdown content.
Remarks
Section titled “Remarks”This schema is used to validate Markdown objects that are specifically
intended for use with the Astro flavor. It ensures that the flavor
property is set to 'astro'
and that the sanitize
property conforms
to the StudioCMSSanitizeOptionsSchema
.
MarkdownSchema
Section titled “MarkdownSchema”const MarkdownSchema: ZodDefault<MarkdownSchemaOptions>;
Defined in: studiocms/packages/@studiocms/md/src/types.ts:77^
Defines a Zod schema for Markdown content, allowing either AstroMarkdownSchema
or StudioCMSMarkdownSchema
.
The schema is optional and defaults to an object with the flavor set to ‘studiocms’.
Remarks
Section titled “Remarks”This schema is useful for validating Markdown data that may conform to different formats, providing flexibility in content handling within the application.
StudioCMSMarkdownSchema
Section titled “StudioCMSMarkdownSchema”const StudioCMSMarkdownSchema: ZodObject<StudioCMSMarkdownOptions>;
Defined in: studiocms/packages/@studiocms/md/src/types.ts:43^
Schema definition for StudioCMS Markdown configuration.