docs: show live examples in favor of static images#5867
docs: show live examples in favor of static images#5867ndonkoHenri wants to merge 52 commits intomainfrom
Conversation
# Conflicts: # sdk/python/examples/poc/README.md # sdk/python/packages/flet/docs/apps/examples-gallery/pyproject.toml
…prove modification time calculation
# Conflicts: # sdk/python/packages/flet/docs/controls/row.md # sdk/python/packages/flet/docs/controls/searchbar.md # sdk/python/packages/flet/docs/controls/slider.md
There was a problem hiding this comment.
The pull request #5867 has too many files changed.
The GitHub API will only let us fetch up to 300 changed files, and this pull request has 737.
There was a problem hiding this comment.
Pull request overview
This PR transitions the Flet documentation from static images to live, interactive examples by creating an examples gallery app that's packaged and embedded via iframes. The changes primarily add if __name__ == "__main__": guards to all example files to enable them to run as standalone scripts, along with various code improvements including import reordering, simplified logic, and removal of unused dependencies.
Key Changes
- Added
if __name__ == "__main__":guards to 100+ example files for standalone execution - Standardized import ordering (flet first, then third-party packages)
- Inlined external data dependencies (e.g., desserts data in datatable examples)
- Refactored code for improved clarity (e.g.,
disabledinstead ofvisiblefor web-specific buttons)
Reviewed changes
Copilot reviewed 128 out of 737 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/examples/controls/**/*.py | Added if __name__ == "__main__" guards to enable standalone execution |
| sdk/python/examples/controls/geolocator/example_1.py | Reordered imports, changed visible=not page.web to disabled=page.web |
| sdk/python/examples/controls/file_picker/pick_and_upload.py | Converted comments to module docstring, improved documentation |
| sdk/python/examples/controls/datatable2/example_2.py | Inlined desserts data from external file, refactored code structure |
| sdk/python/examples/controls/audio/example_1.py | Updated audio URL, improved logging with snackbar display |
| sdk/python/examples/controls/charts/matplotlib_chart/*.py | Removed unnecessary logging configuration |
| .github/workflows/docs.yml | Added new workflow for building documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Deploying flet-docs with
|
| Latest commit: |
cc0c2df
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d90a076a.flet-docs.pages.dev |
| Branch Preview URL: | https://embed-examples-publish.flet-docs.pages.dev |
….8.0 <4.0.0" and ">=3.32.0"
Introduces Dockerfile, Fly.io configuration, and deployment script for the examples-gallery app. Updates pyproject.toml dependencies, adds flet-web and matplotlib, and reorganizes dev dependencies for improved deployment and development workflow.
…flet into embed-examples-publish
# Conflicts: # sdk/python/packages/flet/docs/controls/progressring.md # sdk/python/packages/flet/docs/controls/radio.md # sdk/python/packages/flet/docs/controls/rangeslider.md # sdk/python/packages/flet/docs/controls/reorderablelistview.md # sdk/python/packages/flet/docs/controls/responsiverow.md
flet publish) at docs runtime, and is hosted along with the docs at/apps/examples-gallery/dist/