This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy at the same URL with .md appended. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

OutputGenerationService Pennington.Generation

Generates a static site by HTTP-crawling the running app. Pages are fetched in priority order: HTML content first, then MapGet routes (like /styles.css) last. MonorailCSS Discovery's IL scan populates the class registry at startup, so the stylesheet is correct regardless of fetch order; the MapGet-last rule keeps generated endpoints downstream of any other dependencies the same crawler might exercise.

Constructors

OutputGenerationService

#
public OutputGenerationService(IEnumerable<IContentService> contentServices, IEnumerable<IArtifactContentService> artifactServices, OutputOptions outputOptions, IWebHostEnvironment environment, EndpointDataSource endpointDataSource, IFileSystem fileSystem, IInProcessHttpDispatcher dispatcher, IAuditCache auditCache, ILogger<OutputGenerationService> logger, AuditRunner auditRunner = null)

Initializes the service with the dependencies required to crawl the running app and write output.

Parameters

contentServices IEnumerable<IContentService>
artifactServices IEnumerable<IArtifactContentService>
outputOptions OutputOptions
environment IWebHostEnvironment
endpointDataSource EndpointDataSource
fileSystem IFileSystem
dispatcher IInProcessHttpDispatcher
auditCache IAuditCache
logger ILogger<OutputGenerationService>
auditRunner AuditRunner

Fields

NotFoundGeneratorPath string
Default: "/__pennington-404-generator"
Sentinel URL fetched during site generation to produce 404.html. The path is not a real content route — it exists only to trigger the catch-all fallback handler whose rendered HTML is written to disk. Other parts of the engine (e.g. LocalizationOptions.GetAlternateLanguages) must recognize this sentinel so language switchers on 404.html don't emit phantom /{locale}/__pennington-404-generator/ links.

Methods

GenerateAsync

#
public Task<BuildReport> GenerateAsync()

Crawls the running app and writes every discovered route to the output directory.

Returns

Task<BuildReport>

GenerateAsync

#
public Task<BuildReport> GenerateAsync(bool writeToDisk)

Crawls the running app and returns a BuildReport. When writeToDisk is false the output directory is left untouched — the HTTP crawl, diagnostic collection, and link verification still run, which makes this mode suitable for dev-time validators that want the same warnings a real build would produce.

Parameters

writeToDisk bool

Returns

Task<BuildReport>

Pennington.Generation.OutputGenerationService

namespace Pennington.Generation;

/// Generates a static site by HTTP-crawling the running app. Pages are fetched in priority order: HTML content first, then MapGet routes (like /styles.css) last. MonorailCSS Discovery's IL scan populates the class registry at startup, so the stylesheet is correct regardless of fetch order; the MapGet-last rule keeps generated endpoints downstream of any other dependencies the same crawler might exercise.
public class OutputGenerationService
{
    /// Crawls the running app and writes every discovered route to the output directory.
    
public Task<BuildReport> GenerateAsync()
; /// Crawls the running app and returns a BuildReport. When writeToDisk is false the output directory is left untouched — the HTTP crawl, diagnostic collection, and link verification still run, which makes this mode suitable for dev-time validators that want the same warnings a real build would produce.
public Task<BuildReport> GenerateAsync(bool writeToDisk)
; /// Sentinel URL fetched during site generation to produce 404.html. The path is not a real content route — it exists only to trigger the catch-all fallback handler whose rendered HTML is written to disk. Other parts of the engine (e.g. LocalizationOptions.GetAlternateLanguages) must recognize this sentinel so language switchers on 404.html don't emit phantom /{locale}/__pennington-404-generator/ links.
public static const string NotFoundGeneratorPath
; /// Initializes the service with the dependencies required to crawl the running app and write output.
public OutputGenerationService(IEnumerable<IContentService> contentServices, IEnumerable<IArtifactContentService> artifactServices, OutputOptions outputOptions, IWebHostEnvironment environment, EndpointDataSource endpointDataSource, IFileSystem fileSystem, IInProcessHttpDispatcher dispatcher, IAuditCache auditCache, ILogger<OutputGenerationService> logger, AuditRunner auditRunner = null)
; }