Skip to main content

Definition

Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: CloudNimble.DotNetDocs.Core Inheritance: System.Object

Syntax

CloudNimble.DotNetDocs.Core.ProjectContext

Summary

Represents MSBuild project context for source intent in documentation generation.

Remarks

Provides metadata such as referenced assembly paths and the conceptual documentation folder path. Used by ProjectContext) to enhance metadata extraction.

Examples

// Default (public members only)
var context = new ProjectContext("ref1.dll", "ref2.dll") { ConceptualPath = "conceptual" };

// Include public and internal members
var context = new ProjectContext([Accessibility.Public, Accessibility.Internal], "ref1.dll", "ref2.dll");

var model = await manager.DocumentAsync("MyLib.dll", "MyLib.xml", context);

Constructors

.ctor

Initializes a new instance of ProjectContext with default settings.

Syntax

public ProjectContext()

.ctor

Initializes a new instance of ProjectContext with optional included members and referenced assemblies.

Syntax

public ProjectContext(System.Collections.Generic.List<Microsoft.CodeAnalysis.Accessibility> includedMembers, params string[] references)

Parameters

NameTypeDescription
includedMembersSystem.Collections.Generic.List<Microsoft.CodeAnalysis.Accessibility?>?List of member accessibilities to include. Defaults to Public if null.
referencesstring[]?Paths to referenced assemblies.

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

ApiReferencePath

Gets or sets the path to the API reference documentation.

Syntax

public string ApiReferencePath { get; set; }

Property Value

Type: string

ConceptualDocsEnabled

Gets or sets whether conceptual documentation features are enabled.

Syntax

public bool ConceptualDocsEnabled { get; set; }

Property Value

Type: bool When true (default), conceptual documentation files are generated for new types and existing conceptual content is loaded. When false, only API documentation from XML comments is processed.

ConceptualPath

Gets or sets the path to the conceptual documentation folder.

Syntax

public string ConceptualPath { get; set; }

Property Value

Type: string The file system path to the folder containing conceptual documentation files.

CreateExternalTypeReferences

Gets or sets whether to create documentation for external types that have extension methods.

Syntax

public bool CreateExternalTypeReferences { get; set; }

Property Value

Type: bool true to create minimal DocType entries for types outside the assembly that are extended by extension methods; false to only relocate extensions for types within the assembly. Default is true.

Remarks

When enabled, extending IServiceCollection creates a documentation page showing only your extension methods, with a link to Microsoft’s official documentation for the complete type definition.

DocumentationReferences

Gets or sets the collection of external documentation references to combine into this documentation collection.

Syntax

public System.Collections.Generic.List<CloudNimble.DotNetDocs.Core.DocumentationReference> DocumentationReferences { get; set; }

Property Value

Type: System.Collections.Generic.List<CloudNimble.DotNetDocs.Core.DocumentationReference> A list of DocumentationReference objects representing external documentation to be combined.

Examples

var context = new ProjectContext
{
    DocumentationReferences = new List&lt;DocumentationReference&gt;
    {
        new DocumentationReference
        {
            ProjectPath = @"C:\repos\auth-service\docs\AuthService.docsproj",
            DocumentationRoot = @"C:\repos\auth-service\docs",
            DestinationPath = "services/auth",
            DocumentationType = "Mintlify",
            IntegrationType = "Tabs"
        }
    }
};

Remarks

Similar to MSBuild’s ProjectReference, this allows creating unified documentation portals by combining multiple separate .docsproj outputs. Each reference specifies where to copy files from and how to integrate navigation.

DocumentationRootPath

Gets or sets the output path for generated documentation.

Syntax

public string DocumentationRootPath { get; set; }

Property Value

Type: string The file system path where documentation output will be generated.

ExcludedTypes

Gets or sets the list of type patterns to exclude from documentation.

Syntax

public System.Collections.Generic.HashSet<string> ExcludedTypes { get; set; }

Property Value

Type: System.Collections.Generic.HashSet<string> Set of type patterns to exclude. Supports wildcards (*) for flexible matching. This is useful for filtering out compiler-generated or test framework-injected types.

Examples

ExcludedTypes = new HashSet<string>

Remarks

Patterns can use wildcards:
  • ”*.TypeName” matches TypeName in any namespace
  • “Namespace.*.TypeName” matches TypeName in any sub-namespace of Namespace
  • “Full.Namespace.TypeName” matches exact fully qualified type name

FileNamingOptions

Gets or sets the file naming options for documentation generation.

Syntax

public CloudNimble.DotNetDocs.Core.Configuration.FileNamingOptions FileNamingOptions { get; set; }

Property Value

Type: CloudNimble.DotNetDocs.Core.Configuration.FileNamingOptions Configuration for how documentation files are named and organized.

HasMintlifyTemplate

Gets or sets whether a MintlifyTemplate is defined.

Syntax

public bool HasMintlifyTemplate { get; set; }

Property Value

Type: bool When true, docs.json will be generated even without assemblies to document. The presence of a template is an explicit signal that the user wants documentation output.

IncludedMembers

Gets or sets the list of member accessibilities to include in documentation.

Syntax

public System.Collections.Generic.List<Microsoft.CodeAnalysis.Accessibility> IncludedMembers { get; set; }

Property Value

Type: System.Collections.Generic.List<Microsoft.CodeAnalysis.Accessibility> List of accessibility levels to include. Defaults to Public only.

IncludeFields

Gets or sets whether to include fields in the documentation.

Syntax

public bool IncludeFields { get; set; }

Property Value

Type: bool When true, public fields (including constants) are included in the documentation. Defaults to false since fields are generally discouraged in favor of properties.

IncludeSystemObjectInheritance

Gets or sets whether to include members inherited from Object.

Syntax

public bool IncludeSystemObjectInheritance { get; set; }

Property Value

Type: bool true to document ToString(), GetHashCode(), Equals(), etc. on every type; false to exclude these common members. Default is true.

Remarks

Setting this to false reduces documentation noise while still including members inherited from other base types and interfaces. This matches the behavior of Microsoft’s official .NET documentation.

References

Gets or sets the collection of paths to referenced assemblies.

Syntax

public System.Collections.Generic.List<string> References { get; set; }

Property Value

Type: System.Collections.Generic.List<string> A collection of file system paths to assemblies referenced by the project being documented.

ShowPlaceholders

Gets or sets whether to show placeholder content in the documentation.

Syntax

public bool ShowPlaceholders { get; set; }

Property Value

Type: bool When true (default), placeholder content is included. When false, files containing the TODO marker comment are skipped during loading.

Methods

EnsureOutputDirectoryStructure

Ensures that the output directory structure exists for all namespaces in the assembly model.

Syntax

public void EnsureOutputDirectoryStructure(CloudNimble.DotNetDocs.Core.DocAssembly assemblyModel, string outputPath)

Parameters

NameTypeDescription
assemblyModelCloudNimble.DotNetDocs.Core.DocAssemblyThe assembly model containing namespaces to create directories for.
outputPathstringThe base output path where directories will be created.

Remarks

This method creates the necessary folder structure when using Folder mode. In File mode, it simply ensures the base output directory exists. This centralizes folder creation logic so renderers can assume directories exist.

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

GetFullConceptualPath

Gets the full path to the conceptual documentation folder.

Syntax

public string GetFullConceptualPath()

Returns

Type: string The absolute path to the conceptual documentation folder if ProjectContext.ConceptualPath is absolute, or the path combined with ProjectContext.DocumentationRootPath if ProjectContext.ConceptualPath is relative.

Examples

// When ConceptualPath is absolute
context.ConceptualPath = "C:\\Docs\\conceptual";
var path = context.GetFullConceptualPath(); // Returns "C:\Docs\conceptual"

// When ConceptualPath is relative
context.DocumentationRootPath = "C:\\Docs";
context.ConceptualPath = "conceptual";
var path = context.GetFullConceptualPath(); // Returns "C:\Docs\conceptual"

Remarks

This method ensures that conceptual paths are always resolved to absolute paths, making it easier to work with conceptual documentation files regardless of whether the path is configured as relative or absolute.

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetNamespaceFolderPath

Converts a namespace string to a folder path based on the configured file naming options.

Syntax

public string GetNamespaceFolderPath(string namespaceName)

Parameters

NameTypeDescription
namespaceNamestringThe namespace name to convert (e.g., “System.Collections.Generic”).

Returns

Type: string The folder path representation of the namespace.

Remarks

When FileNamingOptions.NamespaceMode is NamespaceMode.Folder, this returns a path with folders for each namespace part (e.g., “System/Collections/Generic”). When using NamespaceMode.File, this returns an empty string as no folder structure is created.

GetSafeNamespaceName

Gets the safe namespace name for a given namespace symbol.

Syntax

public string GetSafeNamespaceName(Microsoft.CodeAnalysis.INamespaceSymbol namespaceSymbol)

Parameters

NameTypeDescription
namespaceSymbolMicrosoft.CodeAnalysis.INamespaceSymbolThe namespace symbol.

Returns

Type: string A safe namespace name, using “global” for the global namespace.

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

GetTypeFilePath

Gets the full file path for a type, including namespace folder structure if in Folder mode.

Syntax

public string GetTypeFilePath(string fullyQualifiedTypeName, string extension)

Parameters

NameTypeDescription
fullyQualifiedTypeNamestringThe fully qualified type name (e.g., “System.Text.Json.JsonSerializer”).
extensionstringThe file extension without the dot (e.g., “md”, “yaml”).

Returns

Type: string The file path for the type.

Remarks

In Folder mode: “System.Text.Json.JsonSerializer” becomes “System/Text/Json/JsonSerializer.md” In File mode: “System.Text.Json.JsonSerializer” becomes “System_Text_Json_JsonSerializer.md” (using configured separator)

IsTypeExcluded

Checks if a type should be excluded from documentation based on exclusion patterns.

Syntax

public bool IsTypeExcluded(string fullyQualifiedTypeName)

Parameters

NameTypeDescription
fullyQualifiedTypeNamestringThe fully qualified type name to check.

Returns

Type: bool True if the type should be excluded; otherwise, false.

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

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?