In order to handle static files in the content generation pipeline while still being able to easily validate that no output overwrites any other output without adding special cases we introduce a level above Content that contains all Output. The idea is that all output files derive from Output so that they can be checked against the by_uri map. All files will then follow the discover -> write loop.
17 lines
391 B
Python
17 lines
391 B
Python
from typing import TYPE_CHECKING
|
|
from abc import ABC, abstractmethod
|
|
|
|
if TYPE_CHECKING:
|
|
from omicron.ssg.site import Site # for static checking with mypy
|
|
else:
|
|
Site = "omicron.ssg.site.Site" # for runtime checking with beartype
|
|
|
|
|
|
class Output(ABC):
|
|
def __init__(self, uri: str):
|
|
self.uri = uri
|
|
|
|
@abstractmethod
|
|
def write(self, site: Site) -> None:
|
|
pass
|