ContentEngineExtensions
classNamespace: MyLittleContentEngine
Provides extension methods for configuring and using MyLittleContentEngine services within an ASP.NET Core application.
These methods facilitate static site generation with Blazor, including content management and file processing.
Declaration
public static class ContentEngineExtensions
Inheritance
object
→ ContentEngineExtensions
Methods
AddApiReferenceContentService
methodpublic static IServiceCollection AddApiReferenceContentService(IServiceCollection services, Func<IServiceProvider, ApiReferenceContentOptions> func)
Adds an ApiReferenceContentService to the application's service collection for generating API documentation.
Returns:
IServiceCollection
services IServiceCollection | The application's service collection. |
func Func<IServiceProvider, ApiReferenceContentOptions> |
AddContentEngineService
methodpublic static IServiceCollection AddContentEngineService(IServiceCollection services, Func<IServiceProvider, ContentEngineOptions> configureOptions)
Registers the core MyLittleContentEngine generation services for converting a Blazor application into static HTML, CSS, and JavaScript.
Returns:
IServiceCollection
services IServiceCollection | The application's service collection. |
configureOptions Func<IServiceProvider, ContentEngineOptions> | Optional action to customize the static generation process. |
AddContentEngineStaticContentService
methodpublic static IServiceCollection AddContentEngineStaticContentService(IServiceCollection services, Func<IServiceProvider, ContentEngineContentOptions<TFrontMatter>>? configureOptions)
Adds a ContentFilesService to the application's service collection with custom front matter support.
Returns:
IServiceCollection
services IServiceCollection | The application's service collection. |
configureOptions Func<IServiceProvider, ContentEngineContentOptions<TFrontMatter>>? | Action to customize the content service options. |
AddRoslynService
methodpublic static IServiceCollection AddRoslynService(IServiceCollection services, Func<IServiceProvider, RoslynHighlighterOptions>? configureOptions)
Adds a RoslynHighlighterService to the application's service collection with support for Roslyn highlighter configuration.
Returns:
IServiceCollection
services IServiceCollection | The application's service collection. |
configureOptions Func<IServiceProvider, RoslynHighlighterOptions>? | Action to configure the Roslyn highlighter options. |
RunOrBuildContent
methodpublic static Task RunOrBuildContent(WebApplication app, string[] args)
Conditionally runs the application or generates a static build based on command-line arguments.
Returns:
Task
app WebApplication | The web application. |
args string[] | Command-line arguments passed to the application. |