betty.generate module¶
Provide the Generation API.
- class betty.generate.GenerationContext[source]¶
Bases:
ContextA site generation job context.
- Parameters:
app (
betty.app.App)
- __init__(app: betty.app.App)[source]¶
- Parameters:
app (
betty.app.App)
- class betty.generate.Generator[source]¶
Bases:
objectAn extension that generates (part of) projects’ sites.
- async generate(job_context: betty.generate.GenerationContext) None[source]¶
Generate (part of) a project’s site.
- Parameters:
job_context (
betty.generate.GenerationContext)- Return type:
- async betty.generate.create_file(path: pathlib._local.Path) AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper, bool | None][source]¶
Create the file for a resource.
- Parameters:
path (
pathlib._local.Path)- Return type:
typing.AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper,bool|None]
- async betty.generate.create_html_resource(path: pathlib._local.Path) AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper, bool | None][source]¶
Create the file for an HTML resource.
- Parameters:
path (
pathlib._local.Path)- Return type:
typing.AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper,bool|None]
- async betty.generate.create_json_resource(path: pathlib._local.Path) AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper, bool | None][source]¶
Create the file for a JSON resource.
- Parameters:
path (
pathlib._local.Path)- Return type:
typing.AsyncContextManager[aiofiles.threadpool.text.AsyncTextIOWrapper,bool|None]
- async betty.generate.generate(app: betty.app.App) None[source]¶
Generate a new site.
- Parameters:
app (
betty.app.App)- Return type:
- betty.generate.getLogger() logging.Logger[source]¶
Get the site generation logger.
- Return type: