Skip to content

Commit f5e1581

Browse files
v1: Use macros across the docs, move "raises" to properties, restructure navigation (#5681)
* Refactor docs to use templated metadata and helpers Updated documentation files for Flet controls to use frontmatter metadata (class_name, examples, example_images) and templated helper functions (class_summary, class_members, class_all_options). Example paths and image references now use template variables for consistency. Removed browsercontextmenu.md. This improves maintainability and enables more dynamic documentation generation. * Refactor and clarify docstring Raises sections in controls Moved and consolidated 'Raises' documentation for validation errors into relevant property docstrings across multiple control classes. This improves clarity and consistency in error documentation for Flet controls, making it easier for developers to understand validation requirements for each property. * Refactor image embedding in docs to use macro Replaced Markdown image syntax and caption comments with the `{{ image(...) }}` template across multiple documentation files for consistency and improved maintainability. * Restructure and update Flet documentation Deleted outdated contributing and tutorials docs, moved extension and reference docs to new locations, updated links and section headers for clarity, and improved organization of documentation files. This refactor streamlines navigation and prepares for future documentation improvements. * cleanup CI workflow --------- Co-authored-by: ndonkoHenri <[email protected]>
1 parent 655f36b commit f5e1581

File tree

270 files changed

+2489
-2870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+2489
-2870
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ jobs:
351351
local PACKAGE_NAME="$1"
352352
local SUFFIX=""
353353
local FLAVOR="full"
354-
355354
if [[ "$PACKAGE_NAME" == "flet-desktop-light" ]]; then
356355
SUFFIX="-light"
357356
FLAVOR="light"
@@ -534,11 +533,10 @@ jobs:
534533
source "$SCRIPTS/common.sh"
535534
patch_python_package_versions
536535
uv build --package flet-web --wheel
536+
537537
rm -rf "packages/flet-web/src/flet_web/web"
538538
uv build --package flet-web --sdist
539539
540-
ls -laR dist
541-
542540
- name: Upload artifacts
543541
uses: actions/upload-artifact@v4
544542
with:
@@ -591,7 +589,7 @@ jobs:
591589
py_publish:
592590
name: Publish Python packages to PyPI
593591
runs-on: ubuntu-latest
594-
# if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
592+
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
595593
needs:
596594
- python_tests
597595
- build_flet_package
@@ -615,10 +613,8 @@ jobs:
615613
# remove client to avoid glob conflicts with its contents
616614
rm -rf dist/client
617615
618-
ls -laR
619-
620616
for pkg in flet flet_cli flet_desktop flet_desktop_light flet_web; do
621-
uv publish --dry-run dist/**/${pkg}-*
617+
uv publish dist/**/${pkg}-*
622618
done
623619
624620
# ==============

sdk/python/packages/flet/docs/ads/bannerad.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ example_images: ../examples/controls/ads/media
1414
--8<-- "{{ examples }}/example_1.py"
1515
```
1616

17-
![example_1]({{ example_images }}/example_1.gif){width="80%"}
18-
/// caption
19-
///
17+
{{ image(example_images + "/example_1.gif", alt="example_1", width="80%") }}
18+
2019

2120
{{ class_members(class_name) }}

sdk/python/packages/flet/docs/ads/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ pip install flet-ads # (1)!
3939
--8<-- "{{ examples }}/example_1.py"
4040
```
4141

42-
![example_1]({{ example_images }}/example_1.gif){width="80%"}
43-
/// caption
44-
///
42+
{{ image(example_images + "/example_1.gif", alt="example_1", width="80%") }}
43+
4544

4645
## Packaging
4746

sdk/python/packages/flet/docs/ads/interstitialad.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ example_images: ../examples/controls/ads/media
1414
--8<-- "{{ examples }}/example_1.py"
1515
```
1616

17-
![example_1]({{ example_images }}/example_1.gif){width="80%"}
18-
/// caption
19-
///
17+
{{ image(example_images + "/example_1.gif", alt="example_1", width="80%") }}
18+
2019

2120
{{ class_members(class_name) }}

sdk/python/packages/flet/docs/cli/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
2-
title: Flet CLI
3-
---
1+
# Flet CLI
42

53
Flet command-line interface (CLI) provides an easy way to create, run, test and package Flet apps.
64

sdk/python/packages/flet/docs/contributing/extensions/index.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

sdk/python/packages/flet/docs/contributing/index.md

Lines changed: 0 additions & 278 deletions
This file was deleted.
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
::: flet.AdaptiveControl
1+
---
2+
class_name: flet.AdaptiveControl
3+
---
4+
5+
{{ class_all_options(class_name) }}
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1+
---
2+
class_name: flet.AlertDialog
3+
examples: ../../examples/controls/alert_dialog
4+
example_images: ../examples/controls/alert_dialog/media
5+
---
6+
7+
{{ class_summary(class_name) }}
8+
19
## Examples
210

311
[Live example](https://flet-controls-gallery.fly.dev/dialogs/alertdialog)
412

513
### Modal and non-modal dialogs
614

715
```python
8-
--8<-- "../../examples/controls/alert_dialog/modal_and_non_modal.py"
16+
--8<-- "{{ examples }}/modal_and_non_modal.py"
917
```
1018

11-
![modal-and-non-modal](../examples/controls/alert_dialog/media/modal_and_non_modal.gif){width="80%"}
12-
/// caption
13-
///
19+
{{ image(example_images + "/modal_and_non_modal.gif", alt="modal-and-non-modal", width="80%") }}
20+
1421

15-
::: flet.AlertDialog
22+
{{ class_members(class_name) }}

0 commit comments

Comments
 (0)