Definition
Assembly: CloudNimble.DotNetDocs.Core.dll Namespace: Microsoft.Extensions.DependencyInjection Inheritance: System.ObjectSyntax
Summary
Extension methods for registering DotNetDocs services with dependency injection.Methods
AddDocEnricher
Adds a custom document enricher to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Type Parameters
TEnricher
- The type of enricher to add.
Examples
Remarks
Registers the enricher as Scoped implementation of IDocEnricher. Enrichers add conceptual content to documentation entities.AddDocRenderer
Adds a custom document renderer to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Type Parameters
TRenderer
- The type of renderer to add.
Examples
Remarks
Registers the renderer as Scoped implementation of IDocRenderer.AddDocTransformer
Adds a custom document transformer to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Type Parameters
TTransformer
- The type of transformer to add.
Examples
Remarks
Registers the transformer as Scoped implementation of IDocTransformer. Transformers modify the documentation model before rendering.AddDotNetDocs
Adds DotNetDocs services with all built-in renderers to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
configureContext | System.Action<CloudNimble.DotNetDocs.Core.ProjectContext>? | Optional action to configure the ProjectContext. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Examples
Remarks
This method registers:- ProjectContext as Singleton
- DocumentationManager as Scoped
- All built-in renderers (Markdown, JSON, YAML) as Scoped
- MarkdownXmlTransformer for processing XML documentation tags
AddDotNetDocsCore
Adds only the core DotNetDocs services without any renderers.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
configureContext | System.Action<CloudNimble.DotNetDocs.Core.ProjectContext>? | Optional action to configure the ProjectContext. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Examples
Remarks
Use this method when you want to manually register specific renderers. This registers:- ProjectContext as Singleton
- DocumentationManager as Scoped
AddDotNetDocsPipeline
Adds DotNetDocs services using a fluent pipeline builder.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
configurePipeline | System.Action<CloudNimble.DotNetDocs.Core.Configuration.DotNetDocsBuilder> | Action to configure the documentation pipeline. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Examples
AddJsonRenderer
Adds the JSON renderer to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
configureOptions | System.Action<CloudNimble.DotNetDocs.Core.Renderers.JsonRendererOptions>? | Optional action to configure JsonRendererOptions. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Examples
Remarks
Registers JsonRenderer as Scoped implementation of IDocRenderer.AddMarkdownRenderer
Adds the Markdown renderer to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.
Remarks
Registers MarkdownRenderer as Scoped implementation of IDocRenderer. Also registers MarkdownXmlTransformer to process XML documentation tags.AddYamlRenderer
Adds the YAML renderer to the service collection.Syntax
Parameters
Name | Type | Description |
---|---|---|
services | Microsoft.Extensions.DependencyInjection.IServiceCollection | The service collection. |
Returns
Type:Microsoft.Extensions.DependencyInjection.IServiceCollection
The service collection for chaining.