vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
30 lines (29 loc) • 1.03 kB
TypeScript
import type { PluginWithOptions } from 'markdown-it';
export interface OperationLinkPluginOptions {
/**
* Prefix for operation links
* @default '/operations/'
*/
linkPrefix?: string;
/**
* Function to transform the href before rendering
* @param href The original href
* @returns The transformed href
*/
transformHref?: (href: string) => string;
/**
* Custom function to create the HTML for operation links
* @param href The transformed href
* @param method The HTTP method of the operation
* @param title The title of the operation
* @returns The HTML string for the operation link
*/
createOperationLinkHtml?: (href: string, method: string, title: string) => string;
}
/**
* Markdown-it plugin that transforms links with a specific prefix into operation links
* with method badges and proper styling.
*/
declare const operationLink: PluginWithOptions<OperationLinkPluginOptions>;
export { operationLink };
export default operationLink;