betty.generate module

Provide the Generation API.

class betty.generate.GenerateSiteEvent[source]

Bases: ProjectEvent

Dispatched to generate (part of) a project’s site.

__init__(job_context: GenerationContext)[source]
property job_context: GenerationContext

The site generation job context.

class betty.generate.GenerationContext[source]

Bases: Context

A site generation job context.

__init__(project: Project)[source]
property project: Project

The Betty project this job context is run within.

async betty.generate.create_file(path: Path) AsyncContextManager[AsyncTextIOWrapper][source]

Create the file for a resource.

async betty.generate.create_html_resource(path: Path) AsyncContextManager[AsyncTextIOWrapper][source]

Create the file for an HTML resource.

async betty.generate.create_json_resource(path: Path) AsyncContextManager[AsyncTextIOWrapper][source]

Create the file for a JSON resource.

async betty.generate.generate(project: Project) None[source]

Generate a new site.