docusaurus-plugin-llms 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  A Docusaurus plugin for generating LLM-friendly documentation following the [llmstxt standard](https://llmstxt.org/).
4
4
 
5
+ ## Features
6
+
7
+ - ⚡️ Easy integration with Docusaurus
8
+ - ✅ Zero config required, works out of the box
9
+ - ⚙️ Highly customizable with multiple options
10
+ - 📝 Creates `llms.txt` with section links
11
+ - 📖 Produces `llms-full.txt` with all content in one file
12
+ - 📋 Document ordering control for custom sequence
13
+ - 🔄 Path transformation to customize URL construction
14
+ - 📚 Option to include blog posts
15
+ - 🧩 Custom LLM files for specific documentation sections
16
+ - 🧹 Cleans HTML and normalizes content for optimal LLM consumption
17
+ - 📊 Provides statistics about generated documentation
18
+
19
+ ## Table of Contents
20
+
21
+ - [Installation](#installation)
22
+ - [Configuration Options](#configuration-options)
23
+ - [Available Options](#available-options)
24
+ - [Path Transformation Examples](#path-transformation-examples)
25
+ - [Document Ordering Examples](#document-ordering-examples)
26
+ - [Custom LLM Files](#custom-llm-files)
27
+ - [How It Works](#how-it-works)
28
+ - [Implementation Details](#implementation-details)
29
+ - [Testing](#testing)
30
+ - [Future Enhancements](#future-enhancements)
31
+ - [License](#license)
32
+
5
33
  ## Installation
6
34
 
7
35
  ```bash
@@ -330,19 +358,6 @@ This plugin automatically generates the following files during the build process
330
358
 
331
359
  These files follow the [llmstxt standard](https://llmstxt.org/), making your documentation optimized for use with Large Language Models (LLMs).
332
360
 
333
- ## Features
334
-
335
- - ⚡️ Easy integration with Docusaurus
336
- - ✅ Zero config required, works out of the box
337
- - ⚙️ Highly customizable with multiple options
338
- - 📝 Creates `llms.txt` with section links
339
- - 📖 Produces `llms-full.txt` with all content in one file
340
- - 📋 Document ordering control for custom sequence
341
- - 🔄 Path transformation to customize URL construction
342
- - 📚 Option to include blog posts
343
- - 🧩 Custom LLM files for specific documentation sections
344
- - 🧹 Cleans HTML and normalizes content for optimal LLM consumption
345
- - 📊 Provides statistics about generated documentation
346
361
 
347
362
  ## Implementation Details
348
363
 
@@ -390,5 +405,5 @@ Planned features for future versions:
390
405
  - Specific content tags for LLM-only sections
391
406
 
392
407
  ## License
408
+ This project is licensed under the MIT License.
393
409
 
394
- MIT
package/lib/generator.js CHANGED
@@ -101,7 +101,7 @@ ${fullContentSections.join('\n\n---\n\n')}
101
101
 
102
102
  > ${fileDescription}${versionInfo}
103
103
 
104
- This file contains links to documentation sections following the llmtxt.org standard.
104
+ This file contains links to documentation sections following the llmstxt.org standard.
105
105
 
106
106
  ## Table of Contents
107
107
 
package/lib/index.d.ts CHANGED
@@ -18,3 +18,4 @@ import { PluginOptions } from './types';
18
18
  * @returns Plugin object
19
19
  */
20
20
  export default function docusaurusPluginLLMs(context: LoadContext, options?: PluginOptions): Plugin<void>;
21
+ export type { PluginOptions };
package/lib/types.d.ts ADDED
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Type definitions for the docusaurus-plugin-llms plugin
3
+ */
4
+ /**
5
+ * Interface for processed document information
6
+ */
7
+ export interface DocInfo {
8
+ title: string;
9
+ path: string;
10
+ url: string;
11
+ content: string;
12
+ description: string;
13
+ }
14
+ /**
15
+ * Interface for custom LLM file configuration
16
+ */
17
+ export interface CustomLLMFile {
18
+ /** Name of the output file (e.g., 'llms-python.txt') */
19
+ filename: string;
20
+ /** Glob patterns for files to include */
21
+ includePatterns: string[];
22
+ /** Whether to include full content (true) or just links (false) */
23
+ fullContent: boolean;
24
+ /** Custom title for this file (defaults to site title) */
25
+ title?: string;
26
+ /** Custom description for this file (defaults to site description) */
27
+ description?: string;
28
+ /** Additional patterns to exclude (combined with global ignoreFiles) */
29
+ ignorePatterns?: string[];
30
+ /** Order patterns for controlling file ordering (similar to includeOrder) */
31
+ orderPatterns?: string[];
32
+ /** Whether to include unmatched files last (default: false) */
33
+ includeUnmatchedLast?: boolean;
34
+ /** Version information for this LLM file */
35
+ version?: string;
36
+ }
37
+ /**
38
+ * Plugin options interface
39
+ */
40
+ export interface PluginOptions {
41
+ /** Whether to generate the llms.txt file (default: true) */
42
+ generateLLMsTxt?: boolean;
43
+ /** Whether to generate the llms-full.txt file (default: true) */
44
+ generateLLMsFullTxt?: boolean;
45
+ /** Base directory for documentation files (default: 'docs') */
46
+ docsDir?: string;
47
+ /** Array of glob patterns for files to ignore */
48
+ ignoreFiles?: string[];
49
+ /** Custom title to use in generated files (defaults to site title) */
50
+ title?: string;
51
+ /** Custom description to use in generated files (defaults to site tagline) */
52
+ description?: string;
53
+ /** Custom file name for the links file (default: 'llms.txt') */
54
+ llmsTxtFilename?: string;
55
+ /** Custom file name for the full content file (default: 'llms-full.txt') */
56
+ llmsFullTxtFilename?: string;
57
+ /** Whether to include blog content (default: false) */
58
+ includeBlog?: boolean;
59
+ /** Path transformation options for URL construction */
60
+ pathTransformation?: {
61
+ /** Path segments to ignore when constructing URLs (will be removed if found) */
62
+ ignorePaths?: string[];
63
+ /** Path segments to add when constructing URLs (will be prepended if not already present) */
64
+ addPaths?: string[];
65
+ };
66
+ /** Array of glob patterns for controlling the order of files (files will be processed in the order of patterns) */
67
+ includeOrder?: string[];
68
+ /** Whether to include files that don't match any pattern in includeOrder at the end (default: true) */
69
+ includeUnmatchedLast?: boolean;
70
+ /** Array of custom LLM file configurations */
71
+ customLLMFiles?: CustomLLMFile[];
72
+ /** Global version for all generated LLM files */
73
+ version?: string;
74
+ }
75
+ /**
76
+ * Plugin context with processed options
77
+ */
78
+ export interface PluginContext {
79
+ siteDir: string;
80
+ outDir: string;
81
+ siteUrl: string;
82
+ docsDir: string;
83
+ docTitle: string;
84
+ docDescription: string;
85
+ options: PluginOptions;
86
+ }
package/lib/types.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for the docusaurus-plugin-llms plugin
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-llms",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Docusaurus plugin for generating LLM-friendly documentation following the llmtxt.org standard",
5
5
  "main": "lib/index.js",
6
+ "types": "lib/index.d.ts",
6
7
  "scripts": {
7
8
  "build": "tsc",
8
9
  "watch": "tsc --watch",
package/src/generator.ts CHANGED
@@ -79,7 +79,7 @@ ${fullContentSections.join('\n\n---\n\n')}
79
79
 
80
80
  > ${fileDescription}${versionInfo}
81
81
 
82
- This file contains links to documentation sections following the llmtxt.org standard.
82
+ This file contains links to documentation sections following the llmstxt.org standard.
83
83
 
84
84
  ## Table of Contents
85
85
 
package/src/index.ts CHANGED
@@ -112,4 +112,6 @@ export default function docusaurusPluginLLMs(
112
112
  }
113
113
  },
114
114
  };
115
- }
115
+ }
116
+
117
+ export type { PluginOptions };