← Back to Home • Next: KeyPress Control →
This document explains how PromptPlus’s API documentation is generated and maintained.
API documentation is generated automatically using DefaultDocumentation version 1.2.5.
DefaultDocumentation is a tool that converts the XML comments from C# code into Markdown files, producing complete, navigable API documentation.
docs/
├── api/ # API documentation (generated automatically)
│ ├── PromptPlus.md # Main assembly page
│ ├── PromptPlusLibrary.md # PromptPlusLibrary namespace page
│ ├── InputStyles.md, ... # One page per public type, named after the bare type name
│ └── links.json # External links (optional — not currently present in this repo)
├── getting-started.md # Manual guides
├── [others].md
└── ...
The DefaultDocumentation configuration lives in the src/PromptPlus.csproj file:
<PropertyGroup>
<!-- Generates the XML documentation file -->
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<!-- DefaultDocumentation ONLY in ReleaseDoc, for the net10.0 target -->
<ItemGroup Condition="'$(Configuration)' == 'ReleaseDoc' and '$(TargetFramework)' == 'net10.0'">
<PackageReference Include="DefaultDocumentation" Version="1.2.5">
<!-- <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>. -->
</PackageReference>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'ReleaseDoc' and '$(TargetFramework)' == 'net10.0'">
<DefaultDocumentationFolder>..\docs\api</DefaultDocumentationFolder>
<DefaultDocumentationGeneratedPages>Assembly, Namespaces, Classes, Interfaces, Events, Enums, Structs, Delegates</DefaultDocumentationGeneratedPages>
<DefaultDocumentationGeneratedAccessModifiers>Public</DefaultDocumentationGeneratedAccessModifiers>
<DefaultDocumentationAssemblyPageName>PromptPlus</DefaultDocumentationAssemblyPageName>
<DocIconUrl>https://raw.githubusercontent.com/FRACerqueira/PromptPlus/main/icon.png</DocIconUrl>
<DocIconWidth>120</DocIconWidth>
</PropertyGroup>
ℹ️ After generation, an MSBuild task (
PrependDocIconHeader) adds the icon header (DocIconUrl/DocIconWidth) to the top of every.mdfile generated indocs/api. Note that thePrivateAssets/IncludeAssetsof thePackageReferenceare commented out in the actual project — left as a reference in case they ever need to be re-enabled, not as active configuration.
| Property | Value | Description |
|---|---|---|
Condition |
ReleaseDoc + net10.0 |
Documentation is generated ONLY on builds of the ReleaseDoc configuration on the net10.0 target (not on Release, which packs the NuGet without regenerating docs) |
DefaultDocumentationFolder |
../docs/api |
Output folder for the Markdown files |
DefaultDocumentationGeneratedPages |
Assembly, Namespaces, Classes, Interfaces, Events, Enums, Structs, Delegates |
Pages that are generated |
DefaultDocumentationGeneratedAccessModifiers |
Public |
Documents public members only |
DefaultDocumentationAssemblyPageName |
PromptPlus |
Name of the assembly’s main page (PromptPlus.md) |
DocIconUrl / DocIconWidth |
icon.png / 120 |
Icon header added to each generated .md file |
The documentation is regenerated automatically every time you build the project in the ReleaseDoc configuration for the net10.0 target:
docs/api/Note: On Debug or Release builds (or on targets other than net10.0), the documentation
is not generated — Release is used only to pack the NuGet, without paying the cost of running
DefaultDocumentation.
# From the repository root - ONLY ReleaseDoc generates documentation (net10.0 target)
dotnet build src/PromptPlus.csproj -c ReleaseDoc -f net10.0
# Debug or Release builds do NOT generate documentation
dotnet build src/PromptPlus.csproj -c Debug
dotnet build src/PromptPlus.csproj -c Release
# Check the generated files
Get-ChildItem ..\docs\api\*.md | Select-Object Name, LastWriteTime
For the documentation to be generated correctly, add XML comments to the code:
/// <summary>
/// Writes the specified text to the console.
/// </summary>
/// <param name="text">The text to write.</param>
/// <remarks>
/// This method supports inline markup for styling.
/// Example: <c>[red]Red text[/]</c>
/// </remarks>
/// <example>
/// <code>
/// PromptPlus.Console.WriteLine("Hello, [blue]World[/]!");
/// </code>
/// </example>
public static void WriteLine(string text)
{
// implementation
}
| Tag | Usage |
|---|---|
<summary> |
Brief description of the member |
<param> |
Description of a parameter |
<returns> |
Description of the return value |
<remarks> |
Additional information |
<example> |
Usage examples |
<code> |
Code blocks |
<see> |
Cross-references |
<seealso> |
See also |
<exception> |
Exceptions that may be thrown |
<summary> to a single line<example> for complex methods<see cref="ClassName"/> to create links<exception> to document possible errors<remarks>To make sure the entire public API is documented, you can enable warnings:
<PropertyGroup>
<!-- Warnings for public members without documentation -->
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<NoWarn>$(NoWarn);CS1591</NoWarn> <!-- Remove to see the warnings -->
</PropertyGroup>
Remove ;CS1591 from NoWarn to see warnings about missing documentation.
docs/api/links.json does not currently exist in this repo — DefaultDocumentation supports it,
but it hasn’t been added yet. If you need it, create it at that path with this shape to configure
external links for .NET Framework types:
{
"System": "https://learn.microsoft.com/en-us/dotnet/api/system",
"System.Console": "https://learn.microsoft.com/en-us/dotnet/api/system.console",
"System.Threading.Tasks": "https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks"
}
Add new types as needed to improve the documentation’s links.
To publish the documentation on GitHub Pages:
https://username.github.io/PromptPlus/The generated Markdown files can be used with any documentation platform that supports Markdown.
GenerateDocumentationFile is set to TrueIf you see warnings related to DefaultDocumentation, check:
If there are broken links in the documentation:
links.json for external types<see cref=""> correctly in the XML comments✅ Commit:
PromptPlus.csproj)links.json (if used)❓ Optional:
.md files generated in docs/api/
docs/api/*.md to .gitignore)The choice depends on team preference. Committing lets you see documentation changes in PRs. This repo commits them. See ADR0012V01R01 — Generated API docs are off-limits for manual edits for the related (but distinct) decision that these files must never be hand-edited, only regenerated.
When submitting a Pull Request that adds or modifies public API:
.md files were updatedLast updated: This guide was created alongside the initial DefaultDocumentation setup for PromptPlus.