UNPKG

vuepress-plugin-llms

Version:

📜 VuePress plugin for generating documentation friendly to Large Language Models (LLMs) | 📜 VuePress 插件,用于生成对大语言模型(LLMs)友好的文档。

73 lines (72 loc) 3.46 kB
import type { SiteData } from '@vuepress/core'; import type { LinksExtension, PreparedFile } from '../types.js'; /** Options for generating the `llms.txt` file. | 生成 `llms.txt` 文件的选项。 */ export interface GenerateLLMsTxtOptions { /** The source directory from which to process files. | 处理文件的源目录。 */ srcDir: string; /** Path to the index.md file or equivalent main documentation file. | index.md 文件或等效主文档文件的路径。 */ indexMd: string; /** The template to use for generating the llms.txt file. | 用于生成 llms.txt 文件的模板。 */ LLMsTxtTemplate: string; /** Variables to expand in the template. | 在模板中展开的变量。 */ templateVariables: Record<string, string | boolean | undefined>; /** The site configuration from VuePress. | 来自 VuePress 的站点配置。 */ siteConfig: Pick<SiteData, 'title' | 'description'>; /** The domain to use for absolute URLs. | 用于绝对 URL 的域名。 */ domain?: string; /** Extension to use for links. | 用于链接的扩展名。 */ linksExtension: LinksExtension; /** Whether to use clean URLs (without .html extension) | 是否使用干净的 URL(没有 .html 扩展名) */ cleanUrls: boolean; } /** * Generate the contents of the `llms.txt` file, which contains a table of contents * with links to all sections of the documentation. */ /** * 生成 `llms.txt` 文件的内容,其中包含指向文档所有部分的链接的目录。 */ export declare function generateLLMsTxt(preparedFiles: PreparedFile[], options: GenerateLLMsTxtOptions): Promise<string>; /** Options for generating the `llms-full.txt` file. | 生成 `llms-full.txt` 文件的选项。 */ export interface GenerateLLMsFullTxtOptions { /** The source directory from which to process files. | 处理文件的源目录。 */ srcDir: string; /** The domain to use for absolute URLs. | 用于绝对 URL 的域名。 */ domain?: string; /** Extension to use for links. | 用于链接的扩展名。 */ linksExtension: LinksExtension; /** Whether to use clean URLs (without .html extension) | 是否使用干净的 URL(没有 .html 扩展名) */ cleanUrls: boolean; } /** * Generate the contents of the `llms-full.txt` file, which contains the entire * content of all documentation embedded directly. */ /** * 生成 `llms-full.txt` 文件的内容,其中直接嵌入了所有文档的全部内容。 */ export declare function generateLLMsFullTxt(preparedFiles: PreparedFile[], options: GenerateLLMsFullTxtOptions): Promise<string>; /** * Options for generating the table of contents. */ /** * 生成目录的选项。 */ interface GenerateTOCOptions { /** The source directory from which to process files. | 处理文件的源目录。 */ srcDir: string; /** The domain to use for absolute URLs. | 用于绝对 URL 的域名。 */ domain?: string; /** Extension to use for links. | 用于链接的扩展名。 */ linksExtension: LinksExtension; /** Whether to use clean URLs (without .html extension) | 是否使用干净的 URL(没有 .html 扩展名) */ cleanUrls: boolean; } /** * Generate a table of contents from the prepared files. */ /** * 从准备好的文件生成目录。 */ export declare function generateTOC(preparedFiles: PreparedFile[], options: GenerateTOCOptions): Promise<string>; export {};