Skip to main content

Definition

Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: CloudNimble.DotNetDocs.Core

Syntax

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 AssemblyManager.DocumentAsync to enhance metadata extraction.

Examples

Constructors

.ctor

Initializes a new instance of ProjectContext with default settings.

Syntax

.ctor

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

Syntax

Parameters

.ctor Inherited

Inherited from object

Syntax

Properties

ApiReferencePath

Gets or sets the path to the API reference documentation.

Syntax

Property Value

Type: string

ConceptualDocsEnabled

Gets or sets whether conceptual documentation features are enabled.

Syntax

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

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

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

Property Value

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

Examples

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

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

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

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

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

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

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

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

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

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

Parameters

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

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetConceptualMemberPath

Gets the full path to the conceptual content folder for a member.

Syntax

Parameters

Returns

Type: string The member’s folder inside its type’s conceptual folder.

Examples

Remarks

See ProjectContext.GetConceptualNamespacePath for how the conceptual layout is structured.

GetConceptualNamespacePath

Gets the full path to the conceptual content folder for a namespace.

Syntax

Parameters

Returns

Type: string A nested folder with one level per namespace segment under ProjectContext.GetFullConceptualPath, or a global folder for the global namespace.

Examples

Remarks

Conceptual content is a source tree that people edit, not rendered output, so it always uses this nested layout regardless of FileNamingOptions.NamespaceMode. Placeholder generation and DocumentationManager both resolve folders through these methods, so content is always read from where it was written.

GetConceptualTypePath

Gets the full path to the conceptual content folder for a type.

Syntax

Parameters

Returns

Type: string The type’s folder inside its namespace’s conceptual folder.

Examples

Remarks

See ProjectContext.GetConceptualNamespacePath for how the conceptual layout is structured.

GetFullConceptualPath

Gets the full path to the conceptual documentation folder.

Syntax

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

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

Returns

Type: int

GetNamespaceFolderPath

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

Syntax

Parameters

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.

GetNamespacePagePath

Gets the path of a namespace’s documentation page, relative to the API reference output folder and without an extension.

Syntax

Parameters

Returns

Type: string The page path for the configured ProjectContext.FileNamingOptions.

Examples

Remarks

This is the single source of truth for namespace page locations. Renderers use it to decide where pages are written and XmlTransformerBase uses it to build links to them, so the two always agree.

GetSafeNamespaceName

Gets the safe namespace name for a given namespace symbol.

Syntax

Parameters

Returns

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

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

GetTypeFilePath

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

Syntax

Parameters

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)

GetTypePagePath

Gets the path of a type’s documentation page, relative to the API reference output folder and without an extension.

Syntax

Parameters

Returns

Type: string The page path for the configured ProjectContext.FileNamingOptions.

Examples

Remarks

This is the single source of truth for type page locations. See ProjectContext.GetNamespacePagePath.

IsTypeExcluded

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

Syntax

Parameters

Returns

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

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?