Skip to content

Commit 5443e5e

Browse files
Updated llms.txt processing
1 parent 6357e60 commit 5443e5e

6 files changed

Lines changed: 108 additions & 78 deletions

File tree

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"packageName": "PicoXLSX",
3-
"version": "4.1.0",
4-
"description": "PicoXLSX is a library to generate Microsoft Excel files (XLSX) in an easy and native way. This package is the meta package of PicoXLSX and should be used in most cases as dependency in your project. It uses the dependencies of NanoXLSX",
5-
"nuGetUrl": "https://www.nuget.org/packages/PicoXLSX"
2+
"packageName": "PicoXLSX",
3+
"version": "4.1.0",
4+
"description": "PicoXLSX is a library to generate Microsoft Excel files (XLSX) in an easy and native way. This package is the meta package of PicoXLSX and should be used in most cases as dependency in your project. It uses the dependencies of NanoXLSX",
5+
"nuGetUrl": "https://www.nuget.org/packages/PicoXLSX",
6+
"pmInstallCommand": "Install-Package PicoXLSX",
7+
"cliInstallCommand": "dotnet add package PicoXLSX"
68
}

Docs.IndexGenerator/Config/root-config.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"repositoryUrl": "https://github.com/rabanti-github/PicoXLSX",
77
"demoRepositoryUrl": "https://github.com/rabanti-github/NanoXLSX.Demo",
88
"demoRepositoryUseCaseUrl": "https://github.com/rabanti-github/NanoXLSX.Demo/tree/main/PicoXLSX/Demo/UseCases",
9-
"llmsSummary": "A small, dependency-free .NET library to create Microsoft Excel (XLSX) files. Modular plugin architecture: a Core package plus optional Writer, and Formatting plugins. A Reader can be added separately. Targets .NET Standard 2.0 and .NET Framework 4.5+."
9+
"llmsSummary": "A small, dependency-free .NET library to create Microsoft Excel (XLSX) files. Modular plugin architecture: a Core package plus optional Writer, and Formatting plugins. A Reader can be added separately. Targets .NET Standard 2.0 and .NET Framework 4.5+.",
10+
"llmsBodyParagraph": "PicoXLSX is a meta-package bundling NanoXLSX.Core, NanoXLSX.Writer, and NanoXLSX.Formatting. For read-only applications, use NanoXLSX.Core together with NanoXLSX.Reader separately.",
11+
"llmsUsageSnippetLanguage": "csharp",
12+
"llmsUsageSnippet": "Workbook workbook = new Workbook(\"myWorkbook.xlsx\", \"Sheet1\");\nworkbook.CurrentWorksheet.AddNextCell(\"Some Data\");\nworkbook.CurrentWorksheet.AddNextCell(42);\nworkbook.CurrentWorksheet.GoToNextRow();\nworkbook.CurrentWorksheet.AddNextCell(DateTime.Now);\nworkbook.Save();",
13+
"wikiUrl": "https://github.com/rabanti-github/PicoXLSX/wiki/Getting-started"
1014
}

Docs.IndexGenerator/Generation/LlmsTxtGenerator.cs

Lines changed: 59 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -22,93 +22,103 @@ public static string Build(RootConfig root, MetaPackageConfig meta, PluginConfig
2222
{
2323
var sb = new StringBuilder();
2424

25+
// H1 + blockquote (required by spec)
2526
sb.Append("# ").AppendLine(root.ProjectName);
2627
sb.AppendLine();
2728
sb.Append("> ").AppendLine(root.LlmsSummary);
28-
sb.AppendLine();
2929

30-
sb.AppendLine("## Packages");
30+
// Optional prose paragraph between blockquote and first H2
31+
if (!string.IsNullOrEmpty(root.LlmsBodyParagraph))
32+
{
33+
sb.AppendLine();
34+
sb.AppendLine(root.LlmsBodyParagraph);
35+
}
36+
37+
// Installation section
38+
bool hasPm = !string.IsNullOrEmpty(meta.PmInstallCommand);
39+
bool hasCli = !string.IsNullOrEmpty(meta.CliInstallCommand);
40+
if (hasPm || hasCli)
41+
{
42+
sb.AppendLine();
43+
sb.AppendLine("## Installation");
44+
sb.AppendLine();
45+
if (hasPm)
46+
sb.Append("- Install via NuGet (Package Manager): `").Append(meta.PmInstallCommand).AppendLine("`");
47+
if (hasCli)
48+
sb.Append("- Install via .NET CLI: `").Append(meta.CliInstallCommand).AppendLine("`");
49+
}
50+
51+
// Packages section — spec-compliant [name](url): description links
3152
sb.AppendLine();
32-
sb.Append("Meta package **").Append(meta.PackageName).Append(" v").Append(meta.Version)
33-
.AppendLine("** bundles all of the below.");
53+
sb.AppendLine("## Packages");
3454
sb.AppendLine();
3555

36-
string metaUrl = !string.IsNullOrEmpty(meta.NuGetUrl)
37-
? meta.NuGetUrl
38-
: root.RepositoryUrl;
56+
string metaUrl = !string.IsNullOrEmpty(meta.NuGetUrl) ? meta.NuGetUrl : root.RepositoryUrl;
3957
sb.Append("- [").Append(meta.PackageName).Append("](").Append(metaUrl).Append("): ")
4058
.AppendLine(meta.Description ?? string.Empty);
4159

42-
List<DocEntry> nonBundledEntries = new List<DocEntry>();
43-
4460
foreach (DocEntry e in plugins.Entries)
4561
{
46-
if (!e.Bundled)
47-
{
48-
nonBundledEntries.Add(e);
49-
continue;
50-
}
51-
string url = !string.IsNullOrEmpty(e.NuGetUrl)
52-
? e.NuGetUrl
53-
: (e.Repository ?? string.Empty);
62+
string url = !string.IsNullOrEmpty(e.NuGetUrl) ? e.NuGetUrl : (e.Repository ?? string.Empty);
5463
string description = e.Description ?? string.Empty;
55-
string bundledTag = e.Bundled ? " (bundled)" : string.Empty;
64+
string tag = e.Bundled ? " (bundled)" : string.Empty;
5665
sb.Append("- [").Append(e.Id).Append("](").Append(url).Append("): ")
57-
.Append(description).AppendLine(bundledTag);
66+
.Append(description).AppendLine(tag);
5867
}
5968

60-
if (nonBundledEntries.Count > 0)
69+
// Usage / quick-start section
70+
if (!string.IsNullOrEmpty(root.LlmsUsageSnippet))
6171
{
72+
string lang = root.LlmsUsageSnippetLanguage ?? "csharp";
6273
sb.AppendLine();
63-
sb.AppendLine("Other available packages (not bundled in meta package):");
74+
sb.AppendLine("## Usage");
6475
sb.AppendLine();
65-
foreach (DocEntry e in nonBundledEntries)
66-
{
67-
string url = !string.IsNullOrEmpty(e.NuGetUrl)
68-
? e.NuGetUrl
69-
: (e.Repository ?? string.Empty);
70-
string description = e.Description ?? string.Empty;
71-
sb.Append("- [").Append(e.Id).Append("](").Append(url).Append("): ")
72-
.Append(description).AppendLine();
73-
}
76+
sb.Append("```").AppendLine(lang);
77+
sb.AppendLine(root.LlmsUsageSnippet);
78+
sb.AppendLine("```");
7479
}
7580

81+
// API Documentation — spec-compliant [name](url): description links
7682
sb.AppendLine();
7783
sb.AppendLine("## API Documentation");
7884
sb.AppendLine();
79-
sb.Append("- Combined documentation portal: ").AppendLine(root.ApiDocsUrl);
80-
foreach (var e in plugins.Entries)
85+
sb.Append("- [Combined documentation portal](").Append(root.ApiDocsUrl).AppendLine("): All PicoXLSX packages");
86+
foreach (DocEntry e in plugins.Entries)
8187
{
8288
if (!string.IsNullOrEmpty(e.ApiDocsUrl))
8389
{
84-
sb.Append("- ").Append(e.Id).Append(": ").AppendLine(e.ApiDocsUrl);
90+
string note = !string.IsNullOrEmpty(e.Description) ? e.Description : e.Id + " API reference";
91+
sb.Append("- [").Append(e.Id).Append("](").Append(e.ApiDocsUrl).Append("): ").AppendLine(note);
8592
}
8693
}
8794

95+
// Source — spec-compliant [name](url): description links
8896
sb.AppendLine();
8997
sb.AppendLine("## Source");
9098
sb.AppendLine();
91-
sb.Append("- Primary repository: ").AppendLine(root.RepositoryUrl);
92-
foreach (var e in plugins.Entries)
99+
sb.Append("- [").Append(root.ProjectName).Append("](").Append(root.RepositoryUrl).AppendLine("): Primary repository (meta-package, docs)");
100+
101+
// Deduplicate external repos (multiple entries may share the same repo URL)
102+
var seenRepos = new System.Collections.Generic.HashSet<string>(StringComparer.OrdinalIgnoreCase);
103+
foreach (DocEntry e in plugins.Entries)
93104
{
94-
if (!string.IsNullOrEmpty(e.Repository) &&
95-
!string.Equals(e.Repository, root.RepositoryUrl, StringComparison.OrdinalIgnoreCase))
96-
{
97-
sb.Append("- ").Append(e.Id).Append(" (external): ").AppendLine(e.Repository);
98-
}
105+
if (string.IsNullOrEmpty(e.Repository) ||
106+
string.Equals(e.Repository, root.RepositoryUrl, StringComparison.OrdinalIgnoreCase))
107+
continue;
108+
if (!seenRepos.Add(e.Repository))
109+
continue;
110+
string repoName = !string.IsNullOrEmpty(e.RepositoryDisplayName) ? e.RepositoryDisplayName : e.Id;
111+
sb.Append("- [").Append(repoName).Append("](").Append(e.Repository).AppendLine("): Source code (external)");
99112
}
100113

114+
// Optional section (spec-defined: these entries can be skipped in short contexts)
101115
sb.AppendLine();
102-
sb.AppendLine("## Demos");
103-
sb.AppendLine();
104-
sb.Append("- Repository with running demo use cases: ").AppendLine(root.DemoRepositoryUrl);
105-
sb.Append("- Direct folder URL with use cases for ").Append(root.ProjectName).Append(": ").AppendLine(root.DemoRepositoryUseCaseUrl);
106-
107-
sb.AppendLine();
108-
sb.AppendLine("## Notes");
116+
sb.AppendLine("## Optional");
109117
sb.AppendLine();
110-
sb.AppendLine("- Docs.IndexGenerator/ is a build utility and not part of the public API.");
111-
sb.AppendLine("- This file is generated automatically on build from Docs.IndexGenerator/Config/*.json — do not edit by hand.");
118+
sb.Append("- [Demo repository](").Append(root.DemoRepositoryUrl).AppendLine("): Running demo use cases");
119+
sb.Append("- [").Append(root.ProjectName).Append(" demo use cases](").Append(root.DemoRepositoryUseCaseUrl).AppendLine("): Direct folder with PicoXLSX examples");
120+
if (!string.IsNullOrEmpty(root.WikiUrl))
121+
sb.Append("- [Getting started](").Append(root.WikiUrl).AppendLine("): Wiki / getting started guide");
112122

113123
return sb.ToString();
114124
}

Docs.IndexGenerator/Models/ConfigModels.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@ internal record RootConfig(
2727
string RepositoryUrl,
2828
string DemoRepositoryUrl,
2929
string DemoRepositoryUseCaseUrl,
30-
string LlmsSummary);
30+
string LlmsSummary,
31+
string? LlmsBodyParagraph,
32+
string? LlmsUsageSnippet,
33+
string? LlmsUsageSnippetLanguage,
34+
string? WikiUrl);
3135

3236
internal record MetaPackageConfig(
3337
string PackageName,
3438
string Version,
3539
string? Description,
36-
string? NuGetUrl);
40+
string? NuGetUrl,
41+
string? PmInstallCommand,
42+
string? CliInstallCommand);
3743

3844
internal record PluginConfig(DocEntry[] Entries);
3945
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ PicoXLSX v4.x (NanoXLSX v3.x) is planned as the **long-term supported version**.
6767

6868
## :robot: For AI Agents
6969
For AI agents and LLM tooling, a machine-readable [`llms.txt`](llms.txt) is available.
70+
It lists all packages, installation commands, API documentation, source repositories, and a quick-start code snippet.
7071

7172
## :gear: Requirements
7273

llms.txt

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,48 @@
22

33
> A small, dependency-free .NET library to create Microsoft Excel (XLSX) files. Modular plugin architecture: a Core package plus optional Writer, and Formatting plugins. A Reader can be added separately. Targets .NET Standard 2.0 and .NET Framework 4.5+.
44

5-
## Packages
5+
PicoXLSX is a meta-package bundling NanoXLSX.Core, NanoXLSX.Writer, and NanoXLSX.Formatting. For read-only applications, use NanoXLSX.Core together with NanoXLSX.Reader separately.
6+
7+
## Installation
68

7-
Meta package **PicoXLSX v4.1.0** bundles all of the below.
9+
- Install via NuGet (Package Manager): `Install-Package PicoXLSX`
10+
- Install via .NET CLI: `dotnet add package PicoXLSX`
11+
12+
## Packages
813

914
- [PicoXLSX](https://www.nuget.org/packages/PicoXLSX): PicoXLSX is a library to generate Microsoft Excel files (XLSX) in an easy and native way. This package is the meta package of PicoXLSX and should be used in most cases as dependency in your project. It uses the dependencies of NanoXLSX
1015
- [NanoXLSX.Core](https://www.nuget.org/packages/NanoXLSX.Core): Core library: workbooks, worksheets, cells, styles, colors. Has no external dependencies. (bundled)
1116
- [NanoXLSX.Writer](https://www.nuget.org/packages/NanoXLSX.Writer): Writer plugin: extension methods to save XLSX files. Depends on Core. (bundled)
1217
- [NanoXLSX.Formatting](https://www.nuget.org/packages/NanoXLSX.Formatting): Formatting plugin: in-line cell formatting (rich text). Depends on Core. Maintained in an external repository. (bundled)
18+
- [NanoXLSX.Reader](https://www.nuget.org/packages/NanoXLSX.Reader): Reader plugin: extension methods to load XLSX files. Depends on Core.
1319

14-
Other available packages (not bundled in meta package):
20+
## Usage
1521

16-
- [NanoXLSX.Reader](https://www.nuget.org/packages/NanoXLSX.Reader): Reader plugin: extension methods to load XLSX files. Depends on Core.
22+
```csharp
23+
Workbook workbook = new Workbook("myWorkbook.xlsx", "Sheet1");
24+
workbook.CurrentWorksheet.AddNextCell("Some Data");
25+
workbook.CurrentWorksheet.AddNextCell(42);
26+
workbook.CurrentWorksheet.GoToNextRow();
27+
workbook.CurrentWorksheet.AddNextCell(DateTime.Now);
28+
workbook.Save();
29+
```
1730

1831
## API Documentation
1932

20-
- Combined documentation portal: https://rabanti-github.github.io/PicoXLSX/
21-
- NanoXLSX.Core: https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Core/
22-
- NanoXLSX.Writer: https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Writer/
23-
- NanoXLSX.Formatting: https://rabanti-github.github.io/NanoXLSX.Formatting/
24-
- NanoXLSX.Reader: https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Reader/
33+
- [Combined documentation portal](https://rabanti-github.github.io/PicoXLSX/): All PicoXLSX packages
34+
- [NanoXLSX.Core](https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Core/): Core library: workbooks, worksheets, cells, styles, colors. Has no external dependencies.
35+
- [NanoXLSX.Writer](https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Writer/): Writer plugin: extension methods to save XLSX files. Depends on Core.
36+
- [NanoXLSX.Formatting](https://rabanti-github.github.io/NanoXLSX.Formatting/): Formatting plugin: in-line cell formatting (rich text). Depends on Core. Maintained in an external repository.
37+
- [NanoXLSX.Reader](https://rabanti-github.github.io/NanoXLSX/NanoXLSX.Reader/): Reader plugin: extension methods to load XLSX files. Depends on Core.
2538

2639
## Source
2740

28-
- Primary repository: https://github.com/rabanti-github/PicoXLSX
29-
- NanoXLSX.Core (external): https://github.com/rabanti-github/NanoXLSX
30-
- NanoXLSX.Writer (external): https://github.com/rabanti-github/NanoXLSX
31-
- NanoXLSX.Formatting (external): https://github.com/rabanti-github/NanoXLSX.Formatting
32-
- NanoXLSX.Reader (external): https://github.com/rabanti-github/NanoXLSX
33-
34-
## Demos
35-
36-
- Repository with running demo use cases: https://github.com/rabanti-github/NanoXLSX.Demo
37-
- Direct folder URL with use cases for PicoXLSX: https://github.com/rabanti-github/NanoXLSX.Demo/tree/main/PicoXLSX/Demo/UseCases
41+
- [PicoXLSX](https://github.com/rabanti-github/PicoXLSX): Primary repository (meta-package, docs)
42+
- [NanoXLSX](https://github.com/rabanti-github/NanoXLSX): Source code (external)
43+
- [NanoXLSX.Formatting](https://github.com/rabanti-github/NanoXLSX.Formatting): Source code (external)
3844

39-
## Notes
45+
## Optional
4046

41-
- Docs.IndexGenerator/ is a build utility and not part of the public API.
42-
- This file is generated automatically on build from Docs.IndexGenerator/Config/*.json — do not edit by hand.
47+
- [Demo repository](https://github.com/rabanti-github/NanoXLSX.Demo): Running demo use cases
48+
- [PicoXLSX demo use cases](https://github.com/rabanti-github/NanoXLSX.Demo/tree/main/PicoXLSX/Demo/UseCases): Direct folder with PicoXLSX examples
49+
- [Getting started](https://github.com/rabanti-github/PicoXLSX/wiki/Getting-started): Wiki / getting started guide

0 commit comments

Comments
 (0)