This page documents the structure and fields of afterpython.toml, the configuration file for project metadata that extends beyond what pyproject.toml supports. For information about how this file is synchronized with other configuration files, see Configuration Synchronization System. For the standard Python package metadata, see pyproject.toml Reference.
The afterpython.toml file stores project metadata that is specific to the website and branding aspects of your project but doesn't have a natural place in the standard pyproject.toml format. This includes company information, website URLs, visual assets like logos, and configuration for interactive components like marimo notebooks.
Key characteristics:
pyproject.toml)ap sync to propagate values to myst.yml and authors.yml filesbuild_metadata() to generate the metadata.json used by the SvelteKit frontendSources: afterpython/afterpython.toml1-14 src/afterpython/builders/metadata.py38-62
The following diagram shows how afterpython.toml fits into the configuration ecosystem and how it interacts with the metadata building system.
Diagram: afterpython.toml Data Flow
Sources: src/afterpython/builders/metadata.py38-62 afterpython/afterpython.toml1-14
The [company] section defines information about the organization or entity that maintains the project.
Field Reference:
| Field | Type | Required | Description | Used In |
|---|---|---|---|---|
name | string | Yes | Company or organization name | myst.yml venue.title |
url | string | Yes | Company homepage URL | myst.yml venue.url |
Example:
These values are synchronized to the venue section of all myst.yml files and authors.yml during ap sync.
Sources: afterpython/afterpython.toml2-4
The [website] section configures the project website's URLs, visual assets, and landing page behavior.
Field Reference:
| Field | Type | Required | Description | Default | Notes |
|---|---|---|---|---|---|
url | string | Yes | Project website URL | - | Full URL including protocol |
favicon | string | Yes | Favicon filename | - | Relative to afterpython/static/ |
logo | string | Yes | Logo filename (light theme) | - | Relative to afterpython/static/ |
logo_dark | string | No | Logo filename (dark theme) | Same as logo | Relative to afterpython/static/ |
thumbnail | string | Yes | Default thumbnail image | - | Used as fallback for all content types |
announcement | string | No | Markdown banner string | "" | Shown at the top of the website |
readme_py | string | No | marimo HTML export format | "wasm" | "wasm" or "static" |
Asset Path Resolution:
All asset paths are relative to afterpython/static/. During ap build, these are copied to _website/static/.
The readme_py Logic:
The _resolve_readme_py function determines how afterpython/README.py is treated. It only returns "wasm" or "static" if afterpython/README.py exists and is a valid marimo notebook. If the file is missing or invalid, it returns an empty string, signaling the frontend to fall back to README.md.
Sources: afterpython/afterpython.toml6-13 src/afterpython/builders/metadata.py67-83 afterpython/doc/project_website.md158-166
Each non-documentation content type (blog, tutorial, example, guide) can have its own configuration subsection.
Available Content Type Sections:
[website.blog][website.tutorial][website.example][website.guide]Field Reference:
| Field | Type | Required | Description |
|---|---|---|---|
thumbnail | string | No | Default thumbnail for this content type |
featured_post | string | No | Filename of post to feature in hero section |
Example:
Sources: afterpython/afterpython.toml15-18 afterpython/doc/project_website.md88-146
The following diagram illustrates the "Natural Language Space" of user configuration vs the "Code Entity Space" of the resolution logic.
Diagram: Thumbnail Logic Association
Priority Order:
thumbnail: "custom.png" in markdown/notebook).[website.blog].thumbnail).[website].thumbnail).Sources: afterpython/doc/project_website.md95-118 afterpython/afterpython.toml11
The build_metadata() function in src/afterpython/builders/metadata.py is the primary consumer of afterpython.toml.
Implementation Details:
read_metadata() to get standard package data. src/afterpython/builders/metadata.py53read_afterpython() to parse afterpython.toml. src/afterpython/builders/metadata.py56announcement and resolves readme_py status. src/afterpython/builders/metadata.py58-59metadata.json in the build directory. src/afterpython/builders/metadata.py61-62convert_paths() is called to adjust asset paths (e.g., changing afterpython/static/ to /) so the website can resolve them correctly. src/afterpython/builders/metadata.py64 src/afterpython/builders/metadata.py17-35Sources: src/afterpython/builders/metadata.py17-65
Sources: afterpython/afterpython.toml1-14 afterpython/doc/project_website.md133-137