Skip to main content

Definition

Assembly: CloudNimble.DotNetDocs.Tools.dll Namespace: CloudNimble.DotNetDocs.Tools.Commands Inheritance: CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase

Syntax

CloudNimble.DotNetDocs.Tools.Commands.AddCommand

Summary

Command-line tool for creating and adding a documentation project to a solution file.

Remarks

This command creates a .docsproj file configured for the specified documentation type (defaults to Mintlify) and adds it to the specified solution file (.sln or .slnx). The project is automatically added to a “Docs” solution folder. For .slnx files, the command post-processes the XML to add Type=“C#” attributes to .docsproj nodes.

Constructors

.ctor

Syntax

public AddCommand()

Properties

DocumentationType

Gets or sets the documentation type for the project.

Syntax

public string DocumentationType { get; set; }

Property Value

Type: string?

OutputDirectory

Gets or sets the output directory for the generated documentation project.

Syntax

public string OutputDirectory { get; set; }

Property Value

Type: string?

ProjectName

Gets or sets the name of the documentation project.

Syntax

public string ProjectName { get; set; }

Property Value

Type: string?

Remarks

If not specified, the project name defaults to the solution name.

SolutionPath

Gets or sets the path to the solution file (.sln or .slnx) to use.

Syntax

public string SolutionPath { get; set; }

Property Value

Type: string?

UsePrerelease

Gets or sets whether to use the latest prerelease version of the DotNetDocs.Sdk.

Syntax

public bool UsePrerelease { get; set; }

Property Value

Type: bool

Methods

OnExecute

Executes the command to create and add a documentation project to the specified solution.

Syntax

public System.Threading.Tasks.Task<int> OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app)

Parameters

NameTypeDescription
appMcMaster.Extensions.CommandLineUtils.CommandLineApplicationThe command-line application context used to access command-line arguments and configuration.

Returns

Type: System.Threading.Tasks.Task<int> A task that represents the asynchronous operation. The task result is 0 if the documentation project is created and added successfully; otherwise, 1.

Remarks

If the solution file is not specified, the method attempts to locate one in the current directory. The documentation project is created in the specified output directory or, if not provided, in a default location based on the solution file. Any errors encountered during execution are reported to the console, and a nonzero exit code is returned.