UNPKG

@signalwire/docusaurus-plugin-llms-txt

Version:

Generate Markdown versions of Docusaurus HTML pages and an llms.txt index file

107 lines 5.22 kB
/** * Constants used throughout the plugin * All magic numbers, strings, and repeated values should be defined here */ /** Plugin name used throughout the system */ export declare const PLUGIN_NAME: "docusaurus-plugin-llms-txt"; /** Standard error exit code */ export declare const EXIT_CODE_ERROR: 1; /** Official Docusaurus blog plugin name */ export declare const DOCUSAURUS_BLOG_PLUGIN: "docusaurus-plugin-content-blog"; /** Official Docusaurus pages plugin name */ export declare const DOCUSAURUS_PAGES_PLUGIN: "docusaurus-plugin-content-pages"; /** Content type classifications */ export declare const CONTENT_TYPES: { readonly DOCS: "docs"; readonly BLOG: "blog"; readonly PAGES: "pages"; readonly UNKNOWN: "unknown"; }; /** Union type for content types */ export type ContentType = (typeof CONTENT_TYPES)[keyof typeof CONTENT_TYPES]; /** Root node name for document tree */ export declare const TREE_ROOT_NAME: "root"; /** Index document identifier */ export declare const INDEX_IDENTIFIER: "index"; /** Landing page description suffix */ export declare const LANDING_PAGE_SUFFIX: ": landing page"; /** Cache file name */ export declare const CACHE_FILENAME: "cache.json"; /** Temporary file prefix for atomic operations */ export declare const TEMP_FILE_PREFIX: ".tmp-"; /** JSON pretty print indentation */ export declare const JSON_INDENT: 2; /** Hash display length for logging */ export declare const HASH_DISPLAY_LENGTH: 8; /** HTML selectors for content extraction */ export declare const HTML_SELECTORS: { readonly H1: "h1"; readonly TITLE: "title"; readonly META_DESCRIPTION: "meta[name=\"description\"]"; readonly BODY: "body"; readonly MAIN: "main"; }; /** Default document title when none found */ export declare const DEFAULT_DOCUMENT_TITLE: "Untitled Document"; /** Index HTML file name */ export declare const INDEX_HTML: "index.html"; /** Index markdown file name */ export declare const INDEX_MD: "/index.md"; /** Validation error messages */ export declare const VALIDATION_MESSAGES: { readonly OBJECT_REQUIRED: "Plugin options must be an object. Example: { outputDir: \"llms\", includeRoutes: [\"*\"] }"; readonly PARENT_DIR_FORBIDDEN: "cannot contain parent directory references (..) for security reasons. Use paths relative to your project root."; readonly RELATIVE_PATH_REQUIRED: "must be relative to project root. Remove leading \"/\" or use paths like \"docs/\" instead of \"/docs/\""; readonly INVALID_CONFIG: "Invalid plugin configuration. Check your docusaurus.config.js plugin options against the documentation."; readonly UNKNOWN_ERROR: "Unknown error during configuration validation. Please check your plugin options and try again. Consider enabling debug logging for more details."; readonly ROUTE_RULE_MULTIPLE_CATEGORIES: "Multiple categories defined for route"; readonly ROUTE_RULE_MULTIPLE_ORDERS: "Multiple includeOrders defined for route"; readonly USING_LAST_DEFINITION: "Using last definition."; }; /** Cache error messages */ export declare const CACHE_MESSAGES: { readonly NO_ROUTES: "No cached routes found. Run \"npm run build\" to generate the Docusaurus site first, then use the CLI commands."; readonly CONFIG_CHANGED_CLI: "Configuration changed since last build - applying current plugin settings to cached routes"; readonly CONFIG_CHANGED_BUILD: "Configuration changed - rebuilding cache with new settings"; readonly USING_CACHED: "Using cached data from previous build"; readonly CONFIG_CHANGED_REGENERATE: "Configuration changed - regenerating output files with current plugin settings"; }; /** Processing messages */ export declare const PROCESSING_MESSAGES: { readonly NO_DOCUMENTS: "No documents found to generate llms.txt"; }; /** * Centralized error messages for better user experience * @internal */ export declare const ERROR_MESSAGES: { readonly ROUTE_PROCESSING_FAILED: (route: string, error: string) => string; readonly CLI_OPERATION_FAILED: (operation: string, error: string) => string; readonly PLUGIN_BUILD_FAILED: (error: string) => string; readonly HTML_PROCESSING_FAILED: (error: string) => string; readonly FILE_REMOVAL_FAILED: (filePath: string, error: string) => string; }; /** @internal */ export declare const DEFAULT_MARKDOWN_HEADER_LEVEL: 2; /** @internal */ export declare const MD_EXTENSION: ".md"; /** @internal */ export declare const HTML_OR_MD_EXTENSION_REGEX: RegExp; export declare const DEFAULT_SITE_TITLE: "Documentation"; export declare const DEFAULT_DEPTH: 1; /** @internal */ export declare const ROOT_ROUTE_PATH: "/"; /** @internal */ export declare const INDEX_ROUTE_PATH: "/index.md"; export declare const DEFAULT_CONTENT_SELECTORS: readonly [".theme-doc-markdown", "main .container .col", "main .theme-doc-wrapper", "article", "main .container", "main"]; /** @internal */ export declare const LLMS_TXT_FILENAME: "llms.txt"; /** @internal */ export declare const LLMS_FULL_TXT_FILENAME: "llms-full.txt"; import type { Options as GfmOptions } from 'remark-gfm'; /** * Default options for remark-gfm plugin * @internal */ export declare const DEFAULT_GFM: GfmOptions; //# sourceMappingURL=constants.d.ts.map