This commit is contained in:
@@ -1,11 +1,46 @@
|
||||
"""
|
||||
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:
|
||||
"""Renderer configuration container."""
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user