All checks were successful
continuous-integration/drone/tag Build is passing
47 lines
1.1 KiB
Python
47 lines
1.1 KiB
Python
"""
|
|
This module defines the base interfaces and configuration containers for
|
|
doc-forge renderers. All renderer implementations should adhere to the
|
|
DocRenderer protocol.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
from typing import Protocol
|
|
|
|
from docforge.model import Project
|
|
|
|
|
|
class RendererConfig:
|
|
"""
|
|
Configuration container for documentation renderers.
|
|
|
|
Args:
|
|
out_dir: The directory where documentation files should be written.
|
|
project: The introspected project model to be rendered.
|
|
"""
|
|
|
|
def __init__(self, out_dir: Path, project: Project) -> None:
|
|
self.out_dir = out_dir
|
|
self.project = project
|
|
|
|
|
|
class DocRenderer(Protocol):
|
|
"""
|
|
Protocol defining the interface for documentation renderers.
|
|
"""
|
|
|
|
name: str
|
|
|
|
def generate_sources(
|
|
self,
|
|
project: Project,
|
|
out_dir: Path,
|
|
) -> None:
|
|
"""
|
|
Generate renderer-specific source files for the given project.
|
|
|
|
Args:
|
|
project: The project model containing modules and objects.
|
|
out_dir: Target directory for the generated files.
|
|
"""
|
|
...
|