HelpLine.Docs
0.1.0-preview.26
See the version list below for details.
dotnet add package HelpLine.Docs --version 0.1.0-preview.26
NuGet\Install-Package HelpLine.Docs -Version 0.1.0-preview.26
<PackageReference Include="HelpLine.Docs" Version="0.1.0-preview.26" />
<PackageVersion Include="HelpLine.Docs" Version="0.1.0-preview.26" />
<PackageReference Include="HelpLine.Docs" />
paket add HelpLine.Docs --version 0.1.0-preview.26
#r "nuget: HelpLine.Docs, 0.1.0-preview.26"
#:package HelpLine.Docs@0.1.0-preview.26
#addin nuget:?package=HelpLine.Docs&version=0.1.0-preview.26&prerelease
#tool nuget:?package=HelpLine.Docs&version=0.1.0-preview.26&prerelease
HelpLine.Docs
Provide rich documentation directly in your CLI app.
1. Add Markdown files to your source project
Create a Docs\ folder in your project and add one or more Markdown files:
MyCli/
Docs/
getting-started.md
advanced-usage.md
2. Build-time embedding
When your project references the HelpLine.Docs package, its transitive MSBuild targets automatically embed all *.md files under Docs\ as assembly resources. No .csproj changes are needed for the default setup.
To use a different source folder, set the MSBuild property:
<PropertyGroup>
<HelpLineMarkdownTopicsRoot>MyCustomFolder</HelpLineMarkdownTopicsRoot>
</PropertyGroup>
3. Register the docs command
using HelpLine.Docs;
using System.CommandLine;
var catalog = DocsTopicCatalog.FromAssemblyResourcesByHeadingLevel(typeof(Program).Assembly, 1);
var rootCommand = new RootCommand("sample");
rootCommand.Add(new DocsCommand(catalog));
This discovers embedded Markdown topics from the specified assembly and adds a docs subcommand.
4. Use at runtime
sample docs list
sample docs --topic getting-started
Topic names come from the Markdown file names. For example, Docs/getting-started.md becomes the getting-started topic.
5. Advanced usage
For full control over how headings map to topics, use the FromAssemblyResources overload with a heading mapper:
var catalog = DocsTopicCatalog.FromAssemblyResources(typeof(Program).Assembly, context =>
{
if (context.HeadingLevel == 2)
{
context.AppendToTopic(context.HeadingText);
}
});
rootCommand.Add(new DocsCommand(catalog));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Markdig (>= 1.1.3)
- Spectre.Console (>= 0.49.1)
- System.CommandLine (>= 2.0.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.37 | 60 | 5/18/2026 |
| 0.1.0-preview.35 | 59 | 5/14/2026 |
| 0.1.0-preview.30 | 51 | 5/14/2026 |
| 0.1.0-preview.28 | 54 | 5/8/2026 |
| 0.1.0-preview.26 | 48 | 5/6/2026 |
| 0.1.0-preview.20 | 52 | 5/5/2026 |