Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 2c4c6e7

Browse files
committed
mkdocs
1 parent 45d5ab7 commit 2c4c6e7

10 files changed

Lines changed: 312 additions & 16 deletions

File tree

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches:
6+
- v1
7+
paths:
8+
- 'LICENSE'
9+
- 'CHANGELOG.md'
10+
- 'docs/**'
11+
- 'mkdocs.yml'
12+
- 'pyproject.toml'
13+
- '.github/workflows/docs.yml'
14+
- 'src/flet_flashlight/**'
15+
- 'examples/flashlight_example/src/main.py'
16+
17+
workflow_dispatch: # Allow manual trigger from the GitHub Actions UI
18+
19+
concurrency:
20+
group: "docs" # Prevent multiple overlapping deploys
21+
cancel-in-progress: false # Allow in-progress deploys to finish
22+
23+
permissions:
24+
contents: write # Required to push to the gh-pages branch
25+
26+
env:
27+
GH_TOKEN: ${{ secrets.GH_TOKEN }} # Token used by mkdocs for pushing
28+
UV_SYSTEM_PYTHON: 1 # Use system Python interpreter with uv
29+
30+
jobs:
31+
deploy:
32+
name: Deploy Documentation
33+
runs-on: ubuntu-latest
34+
if: github.repository == github.event.repository.full_name # don't run on forks
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Configure Git for mkdocs
40+
run: |
41+
git config user.name github-actions[bot]
42+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
43+
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v6
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version-file: "pyproject.toml" # Match Python version with project config
51+
52+
- name: Install dependencies
53+
run: |
54+
uv pip install -e .
55+
uv pip install --group docs
56+
57+
- name: Deploy to GitHub Pages
58+
run: uv run mkdocs gh-deploy --force

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased] - 2025-mm-dd
9+
10+
### Added
11+
12+
- Deployed online documentation: https://flet-dev.github.io/flet-flashlight/
13+
14+
### Changed
15+
16+
TBA
17+
18+
## [0.1.0] - 2025-01-15
19+
20+
Initial release.
21+
22+
23+
[Unreleased]: https://github.com/flet-dev/flet-flashlight/compare/0.1.0...HEAD
24+
25+
[0.1.0]: https://github.com/flet-dev/flet-flashlight/releases/tag/0.1.0

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Changelog
3+
---
4+
5+
--8<-- "CHANGELOG.md"

docs/flashlight.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
::: flet_flashlight.flashlight.Flashlight

docs/images/favicon.ico

15 KB
Binary file not shown.

docs/images/logo.svg

Lines changed: 19 additions & 0 deletions
Loading

docs/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# flet-flashlight
2+
3+
[![pypi](https://img.shields.io/pypi/v/flet-flashlight.svg)](https://pypi.python.org/pypi/flet-flashlight)
4+
[![downloads](https://static.pepy.tech/badge/flet-flashlight/month)](https://pepy.tech/project/flet-flashlight)
5+
[![license](https://img.shields.io/github/license/flet-dev/flet-flashlight.svg)](https://github.com/flet-dev/flet-flashlight/blob/main/LICENSE)
6+
7+
A Flet extension to manage the device torch/flashlight.
8+
9+
It is based on the [flashlight](https://pub.dev/packages/flashlight) Flutter package.
10+
11+
## Platform Support
12+
13+
This package supports the following platforms:
14+
15+
| Platform | Supported |
16+
|----------|:---------:|
17+
| Windows ||
18+
| macOS ||
19+
| Linux ||
20+
| iOS ||
21+
| Android ||
22+
| Web ||
23+
24+
## Example
25+
26+
```python title="main.py"
27+
--8<-- "examples/flashlight_example/src/main.py"
28+
```

docs/license.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Licence
3+
---
4+
5+
```
6+
--8<-- "LICENSE"
7+
```

mkdocs.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Project information
2+
site_name: "flet-flashlight"
3+
site_url: https://flet-dev.github.io/flet-flashlight/
4+
site_author: Flet Contributors
5+
site_description: A Flet extension to manage the device torch/flashlight.
6+
7+
# Repository
8+
edit_uri: edit/main/docs/
9+
repo_name: flet-dev/flet-flashlight
10+
repo_url: https://github.com/flet-dev/flet-flashlight
11+
12+
# Copyright
13+
copyright: Copyright &copy; 2025 Flet Contributors
14+
15+
# Theme
16+
theme:
17+
name: "material"
18+
favicon: 'images/favicon.ico'
19+
logo: 'images/logo.svg'
20+
icon:
21+
annotation: material/plus-circle
22+
palette:
23+
- scheme: default
24+
primary: indigo
25+
accent: pink
26+
toggle:
27+
icon: material/brightness-7
28+
name: Switch to dark mode
29+
- scheme: slate
30+
primary: indigo
31+
accent: pink
32+
toggle:
33+
icon: material/brightness-4
34+
name: Switch to system preference
35+
- scheme: slate
36+
primary: indigo
37+
accent: pink
38+
toggle:
39+
icon: material/brightness-auto
40+
name: Switch to light mode
41+
features:
42+
- content.action.edit
43+
- content.action.view
44+
- content.action.annotate
45+
- content.action.copy
46+
- content.action.tooltips
47+
- content.code.annotate
48+
- content.code.copy
49+
- content.code.select
50+
# - navigation.tabs
51+
- navigation.instant
52+
- navigation.tracking
53+
- navigation.sections
54+
- navigation.footer
55+
- navigation.top
56+
- search.highlight
57+
- search.share
58+
- search.suggest
59+
- toc.follow
60+
61+
extra:
62+
version:
63+
provider: mike
64+
social:
65+
- icon: fontawesome/brands/github
66+
link: https://github.com/flet-dev
67+
- icon: fontawesome/brands/discord
68+
link: https://discord.gg/bCFXYgZR3b
69+
- icon: fontawesome/brands/x-twitter
70+
link: https://x.com/fletdev
71+
- icon: fontawesome/brands/bluesky
72+
link: https://bsky.app/profile/fletdev.bsky.social
73+
74+
# Navigation
75+
nav:
76+
- Getting Started: index.md
77+
- API Reference:
78+
- Lottie: lottie.md
79+
- Changelog: changelog.md
80+
- License: license.md
81+
82+
# Validation
83+
validation:
84+
omitted_files: warn
85+
absolute_links: warn
86+
unrecognized_links: warn
87+
anchors: warn
88+
89+
# Watch
90+
watch:
91+
- docs
92+
- src
93+
94+
# Plugins
95+
plugins:
96+
# - footnotes
97+
- search:
98+
lang: en
99+
- mike:
100+
alias_type: symlink
101+
- glightbox
102+
- mkdocstrings:
103+
default_handler: python_xref
104+
handlers:
105+
python_xref:
106+
options:
107+
relative_crossrefs: true
108+
docstring_style: google
109+
show_signature_annotations: true
110+
signature_crossrefs: true
111+
show_symbol_type_heading: true
112+
show_symbol_type_toc: true
113+
show_root_heading: true
114+
show_root_full_path: false
115+
show_bases: true
116+
show_source: false
117+
group_by_category: true
118+
show_category_heading: false
119+
show_labels: false
120+
show_if_no_docstring: true
121+
docstring_section_style: spacy
122+
filters:
123+
- "!^_" # Exclude private members starting with only one underscore
124+
- "^__" # Include private members starting with two underscores
125+
- "!before_update"
126+
inventories:
127+
- url: https://docs.python.org/3/objects.inv
128+
domains: [ py, std ]
129+
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
130+
131+
# Markdown Extensions
132+
markdown_extensions:
133+
- admonition
134+
- toc:
135+
permalink: "#"
136+
- pymdownx.highlight:
137+
anchor_linenums: true
138+
line_spans: __span
139+
pygments_lang_class: true
140+
- pymdownx.inlinehilite
141+
- pymdownx.snippets
142+
- pymdownx.superfences
143+
- pymdownx.details
144+
- pymdownx.magiclink:
145+
repo_url_shorthand: true
146+
- pymdownx.tabbed:
147+
alternate_style: true
148+
- attr_list
149+
- md_in_html
150+
- def_list
151+
- pymdownx.tasklist:
152+
custom_checkbox: true

pyproject.toml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
[project]
22
name = "flet-flashlight"
33
version = "0.2.0"
4-
description = "Flashlight control for Flet"
4+
description = "A Flet extension to manage the device torch/flashlight."
55
readme = "README.md"
6-
authors = [
7-
{ name = "Flet contributors", email = "hello@flet.dev" }
8-
]
6+
authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
97
license = "Apache-2.0"
108
requires-python = ">=3.10"
119
dependencies = [
@@ -14,28 +12,31 @@ dependencies = [
1412

1513
[project.urls]
1614
Homepage = "https://flet.dev"
17-
Documentation = "https://flet.dev/docs/controls/flashlight"
15+
Documentation = "https://flet-dev.github.io/flet-flashlight"
1816
Repository = "https://github.com/flet-dev/flet-flashlight"
1917
Issues = "https://github.com/flet-dev/flet-flashlight/issues"
2018

2119
[tool.setuptools.package-data]
2220
"flutter.flet_flashlight" = ["**/*"]
2321

24-
[tool.uv]
25-
dev-dependencies = [
26-
"flet",
27-
"flet-cli",
28-
"flet-desktop",
29-
#"mkdocs",
30-
#"mkdocs-material",
31-
#"mkdocstrings[python]"
22+
[dependency-groups]
23+
dev = [
3224
"pre-commit>=4.2.0",
3325
]
26+
docs = [
27+
"mkdocs",
28+
"mkdocs-material",
29+
"mkdocstrings[python]",
30+
"mkdocstrings-python-xref",
31+
"mike",
32+
"markdown>=3.6",
33+
"pymdown-extensions",
34+
"mkdocs-glightbox",
35+
"pygments>=2.16",
36+
]
3437

3538
[tool.uv.sources]
36-
flet = { git = "https://github.com/flet-dev/flet", subdirectory = "sdk/python/packages/flet", rev = "v1" }
37-
flet-cli = { git = "https://github.com/flet-dev/flet", subdirectory = "sdk/python/packages/flet-cli", rev = "v1" }
38-
flet-desktop = { git = "https://github.com/flet-dev/flet", subdirectory = "sdk/python/packages/flet-desktop", rev = "v1" }
39+
# flet = { git = "https://github.com/flet-dev/flet", subdirectory = "sdk/python/packages/flet", rev = "v1" }
3940

4041
[build-system]
4142
requires = ["setuptools"]

0 commit comments

Comments
 (0)