-
Notifications
You must be signed in to change notification settings - Fork 651
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Enable users to export the current Preswald app's rendered state into a well-formatted Markdown report via the CLI. This makes it easy to generate lightweight, version-controllable, and GitHub/GitLab-friendly snapshots of an app’s output.
Motivation
Markdown exports are useful for:
- Creating reproducible, readable analysis logs
- Sharing results via GitHub, Notion, or static documentation sites
- Archiving outputs alongside source code
- Enhancing developer workflows with Markdown-based reporting
This feature simplifies app-to-doc workflows without requiring frontend interaction or custom tooling.
Acceptance Criteria
-
Add CLI command:
preswald export --format markdown --output report.md -
Run app in headless mode (like
preswald run, but silent) -
Capture the rendered state of all static and interactive components
-
Generate a structured
.mdfile that includes:- Markdown headers from
text() - Data tables from
table() - Inline callouts from
alert() - Markdown-renderable forms of
progress,checkbox,selectbox, etc. - Chart references or alt text from
plotly()(optional PNG if--include-imagesis used)
- Markdown headers from
-
Default output path:
exports/app.mdif--outputis not provided
Implementation Plan
- Extend
preswald/cli.pywithexport --format markdown - Add
MarkdownExporterclass inpreswald/utils/exporter.py - Hook into component registry to collect component render calls (reuse internal service from
run) - Implement serialization logic for each supported component type
- Optional: Use Plotly's
to_image()for embedding static PNGs of charts (if--include-imagesis enabled)
Testing Plan
Run:
preswald run
preswald export --format markdown --output output/report.mdValidate:
report.mdis created and readable in VS Code / GitHub preview- Markdown syntax is valid and renders cleanly
- Components show up in correct order, with all user-visible state
Example snapshot:
# My Dashboard
> ✅ Model Training Complete
## Accuracy Chart

## Config
- Region: North America
- Slider value: 70
## Data Preview
| Name | Score |
|------|-------|
| Alice | 88.4 |
| Bob | 92.1 |Related Files
preswald/cli.pypreswald/service.pypreswald/utils/exporter.py- (optional) Add
plotly[kaleido]to extras for chart export
Extra
--include-codeto append the Python source file--include-imagesto embed static charts--format htmlfor rich HTML export- Add GitHub Action for CI-based report generation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request