RazorDocs Search

RazorDocs

Namespaces

ForgeTrust.Runnable.Web.RazorDocs

Reusable Razor Class Library package for harvesting and serving repository documentation inside a Runnable web application.

What it provides

  • RazorDocsWebModule for wiring the docs UI into a Runnable web host
  • AddRazorDocs() for typed options binding and core service registration
  • DocAggregator plus the built-in markdown and C# harvesters
  • Search UI assets and the /docs MVC surface used by RazorDocs consumers

Configuration

Slice 1 supports source-backed docs via RazorDocsOptions:

{
  "RazorDocs": {
    "Mode": "Source",
    "Source": {
      "RepositoryRoot": "/path/to/repo"
    }
  }
}

If RazorDocs:Source:RepositoryRoot is omitted, the package falls back to repository discovery from the app content root. Bundle mode is modeled but intentionally rejected until Slice 2 lands.

Type

RazorDocsOptions

Represents configuration for the RazorDocs package and host.

Property

Mode

RazorDocsMode Mode { get; set; }

Gets or sets the active docs source mode.

Property

Source

RazorDocsSourceOptions Source { get; set; }

Gets source-mode settings used when docs are harvested from a repository checkout.

Property

Bundle

RazorDocsBundleOptions Bundle { get; set; }

Gets bundle-mode settings used by future bundle-backed runtime loading.

Property

Sidebar

RazorDocsSidebarOptions Sidebar { get; set; }

Gets sidebar rendering settings.

Type

RazorDocsSourceOptions

Source-mode configuration for RazorDocs.

Property

RepositoryRoot

string? RepositoryRoot { get; set; }

Gets or sets the repository root used for source harvesting. When null, RazorDocs falls back to repository discovery from the content root.

Type

RazorDocsBundleOptions

Bundle-mode configuration for RazorDocs.

Property

Path

string? Path { get; set; }

Gets or sets the path to the docs bundle payload.

Type

RazorDocsSidebarOptions

Sidebar presentation settings for RazorDocs.

Property

NamespacePrefixes

string[] NamespacePrefixes { get; set; }

Gets or sets configured namespace prefixes for sidebar label simplification.

Type

RazorDocsOptionsValidator

Validates RazorDocsOptions and rejects unsupported or ambiguous startup configurations.

Enum

RazorDocsMode

Enumerates the supported RazorDocs content source modes.

Type

RazorDocsServiceCollectionExtensions

Registers RazorDocs services and typed options.

Method

AddRazorDocs

IServiceCollection AddRazorDocs(this IServiceCollection services)

Adds the RazorDocs package services and options to the service collection.

Parameters

  • servicesThe target service collection.

Returns

The same service collection for chaining.

Type

RazorDocsWebModule

Web module configuration for the RazorDocs documentation system.

Method

ConfigureServices

void ConfigureServices(StartupContext context, IServiceCollection services)

Registers services required by the RazorDocs module into the provided service collection.

Remarks

Adds HTML sanitizer, Markdown and C# harvesters, and the documentation aggregator.

Method

RegisterDependentModules

void RegisterDependentModules(ModuleDependencyBuilder builder)

Registers runtime module dependencies for this web module, including RazorWireWebModule.

Parameters

  • builderThe dependency builder used to register required modules.
Method

ConfigureHostBeforeServices

void ConfigureHostBeforeServices(StartupContext context, IHostBuilder builder)

Performs host-level configuration steps before application services are registered.

Parameters

  • contextThe startup context providing module and environment information.
  • builderThe host builder to configure prior to service registration.
Method

ConfigureHostAfterServices

void ConfigureHostAfterServices(StartupContext context, IHostBuilder builder)

Performs host-level configuration steps after application services have been registered.

Parameters

  • contextThe startup context providing module and environment information.
  • builderThe host builder to modify or extend after services are configured.
Method

ConfigureWebApplication

void ConfigureWebApplication(StartupContext context, IApplicationBuilder app)

Configures the application's request pipeline and middleware for this module.

Parameters

  • contextThe startup context for the module invocation.
  • appThe application builder used to configure middleware and endpoints.
Method

ConfigureEndpoints

void ConfigureEndpoints(StartupContext context, IEndpointRouteBuilder endpoints)

Adds the module's default catch-all controller route for documentation endpoints.

Parameters

  • contextStartup context for the application and environment.
  • endpointsEndpoint route builder used to map the module's routes.