Skip to content

# Base

## `` docforge.renderers.base

### Summary

Renderer base interfaces and configuration models.

This module defines the base protocol and configuration container used by doc-forge renderers. Concrete renderer implementations should implement the `DocRenderer` protocol.

### Classes

#### `` DocRenderer

Bases: `Protocol`

Protocol defining the interface for documentation renderers.

Implementations of this protocol are responsible for transforming a `Project` model into renderer-specific documentation sources.

##### Functions

###### `` generate_sources

    1

    generate_sources(project: Project, out_dir: Path) -> None

Generate renderer-specific documentation sources.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`project` | `Project` | Project model containing modules and documentation objects. | required
`out_dir` | `Path` | Directory where generated documentation sources should be written. | required

#### `` RendererConfig

    1

    RendererConfig(out_dir: Path, project: Project)

Configuration container for documentation renderers.

A `RendererConfig` instance groups together the project model and the output directory used during rendering.

Attributes:

Name | Type | Description
--- | --- | ---
`out_dir` | `Path` | Directory where generated documentation files will be written.
`project` | `Project` | Documentation project model to be rendered.

Initialize a RendererConfig instance.

Parameters:

Name | Type | Description | Default
--- | --- | --- | ---
`out_dir` | `Path` | Target directory where documentation files should be written. | required
`project` | `Project` | Introspected project model to render. | required

##### Functions