Definition
Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: CloudNimble.DotNetDocs.Core Inheritance: System.ObjectSyntax
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 byProjectContext)
to enhance metadata extraction.
<example>
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
Name | Type | Description |
---|---|---|
includedMembers | System.Collections.Generic.List<Microsoft.CodeAnalysis.Accessibility?>? | List of member accessibilities to include. Defaults to Public if null. |
references | string[]? | Paths to referenced assemblies. |
Properties
ApiReferencePath
Gets or sets the path to the API reference documentation.Syntax
Property Value
Type:string
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.
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.
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.
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
Name | Type | Description |
---|---|---|
assemblyModel | CloudNimble.DotNetDocs.Core.DocAssembly | The assembly model containing namespaces to create directories for. |
outputPath | string | The 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.GetNamespaceFolderPath
Converts a namespace string to a folder path based on the configured file naming options.Syntax
Parameters
Name | Type | Description |
---|---|---|
namespaceName | string | The 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
Parameters
Name | Type | Description |
---|---|---|
namespaceSymbol | Microsoft.CodeAnalysis.INamespaceSymbol | The namespace symbol. |
Returns
Type:string
A safe namespace name, using “global” for the global namespace.
GetTypeFilePath
Gets the full file path for a type, including namespace folder structure if in Folder mode.Syntax
Parameters
Name | Type | Description |
---|---|---|
fullyQualifiedTypeName | string | The fully qualified type name (e.g., “System.Text.Json.JsonSerializer”). |
extension | string | The 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
Parameters
Name | Type | Description |
---|---|---|
fullyQualifiedTypeName | string | The fully qualified type name to check. |
Returns
Type:bool
True if the type should be excluded; otherwise, false.