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()

.ctor Inherited

Inherited from CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase

Syntax

public DocsCommandBase()

.ctor Inherited

Inherited from object

Syntax

public Object()

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.

SkipSolution

Gets or sets whether to skip adding the project to the solution file.

Syntax

public bool SkipSolution { get; set; }

Property Value

Type: bool

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

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetLatestSdkVersionAsync Inherited

Inherited from CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase
Queries NuGet.org for the latest version of the DotNetDocs.Sdk package.

Syntax

protected static System.Threading.Tasks.Task<string> GetLatestSdkVersionAsync(bool includePrerelease)

Parameters

NameTypeDescription
includePrereleaseboolWhether to include prerelease versions in the search.

Returns

Type: System.Threading.Tasks.Task<string?> The latest version string, or null if the query fails.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

GetVersion Inherited

Inherited from CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase
Gets the version string for the tool.

Syntax

internal static string GetVersion()

Returns

Type: string The version string.

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

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.

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?

WriteHeader Inherited

Inherited from CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase
Writes the DotNetDocs CLI header to the console with colorful ASCII art and version information.

Syntax

public static void WriteHeader()

Remarks

This method displays a multi-line ASCII art logo combining the DotNetDocs branding with version and attribution information. The output uses console colors to create an eye-catching header for CLI operations.