betty.generate module - Betty 0.4.0a4 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.generate module

Provide the Generation API.

class betty.generate.GenerateSiteEvent

  Bases: `ProjectEvent`

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

  __init__(job_context: GenerationContext)
  property job_context: GenerationContext

    The site generation job context.

class betty.generate.GenerationContext

  Bases: `Context`

  A site generation job context.

  __init__(project: Project)
  property project: Project

    The Betty project this job context is run within.

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

  Create the file for a resource.

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

  Create the file for an HTML resource.

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

  Create the file for a JSON resource.

async betty.generate.generate(project: Project) → None

  Generate a new site.