@signalwire/docusaurus-plugin-llms-txt
Version:
Generate Markdown versions of Docusaurus HTML pages and an llms.txt index file
37 lines • 1.15 kB
TypeScript
/**
* Utilities for URL handling and formatting
*/
/**
* Ensure a path starts with a forward slash
* @internal
*/
export declare function ensureLeadingSlash(path: string): string;
/**
* Remove leading slash from a path
* @internal
*/
export declare function removeLeadingSlash(path: string): string;
/**
* Strip baseUrl from a route path
* @internal
*
* @param routePath - The full route path (e.g., "/my-project/docs/intro")
* @param baseUrl - The site's baseUrl (e.g., "/my-project/")
* @returns The path without baseUrl (e.g., "/docs/intro")
*/
export declare function stripBaseUrl(routePath: string, baseUrl: string): string;
/**
* Centralized URL formatting that handles all edge cases consistently
* @internal
*
* @param routePath - Document route path (always starts with /)
* @param options - URL formatting options
* @param baseUrl - Base URL for absolute paths
* @returns Properly formatted URL
*/
export declare function formatUrl(routePath: string, options: {
enableMarkdownFiles?: boolean;
relativePaths?: boolean;
markdownFile?: string;
}, baseUrl?: string): string;
//# sourceMappingURL=url.d.ts.map