Skip to content

Expose programmatic demo manifests for non-Playwright-test flows#52

Merged
jmjava merged 1 commit intomainfrom
cursor/expose-demo-manifest-api-d104
May 5, 2026
Merged

Expose programmatic demo manifests for non-Playwright-test flows#52
jmjava merged 1 commit intomainfrom
cursor/expose-demo-manifest-api-d104

Conversation

@jmjava
Copy link
Copy Markdown
Owner

@jmjava jmjava commented May 5, 2026

Summary

Projects without @playwright/test specs or pytest markers still need a supported way to drive demo-function rendering (CLI/VHS or declarative Python-driven Playwright).

Changes

  • manifest_from_mapping — Public wrapper around the existing manifest coercion logic. Builds a validated Manifest from the same dict shape as a *.docgen.yaml, optionally with source_path for resolving relative tape, fixtures, etc.
  • docgen package exports — Re-export demo-function API (load_manifest, render, manifest_from_mapping, exit-code constants, dataclasses, …) from docgen.__init__ so consumers can from docgen import …. __version__ is aligned with pyproject.toml (0.2.0).

Usage sketch

from pathlib import Path
from docgen import manifest_from_mapping, render

m = manifest_from_mapping(
    {
        "identifier": "my-cli-fn",
        "intent": "One sentence narration.",
        "demonstration": {"kind": "cli", "tape": "demos/demo.tape"},
        "output_budget": {"duration_seconds": 30, "resolution": "1280x720"},
    },
    source_path=Path(__file__).resolve(),
)
render(m, Path("out/demo-fn"))

Tests: tests/test_demo_function.py::test_manifest_from_mapping_cli, tests/test_package_exports.py.

Open in Web Open in Cursor 

…ckage

Add manifest_from_mapping() as the supported way to build demo manifests from
dicts for CLI/VHS or declarative Playwright flows without TS/pytest paths.
Re-export demo-function symbols from docgen.__init__ with version aligned to
pyproject. Include tests for programmatic CLI manifests and package imports.

Co-authored-by: John Menke <jmjava@gmail.com>
@jmjava jmjava marked this pull request as ready for review May 5, 2026 15:29
@jmjava jmjava merged commit 99d430f into main May 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants