Skip to content

Commit 1b8031b

Browse files
committed
Better mkdocstrings
1 parent 78c7c49 commit 1b8031b

File tree

10 files changed

+19
-17
lines changed

10 files changed

+19
-17
lines changed

.github/workflows/test-docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,20 @@ jobs:
2020
- uses: actions/setup-python@v5
2121
with:
2222
python-version: 3.x
23-
- name: Check docs build
23+
- name: Install Python Dependencies
2424
run: |
2525
pip install -r requirements/build-docs.txt
26+
pip install -r requirements/check-types.txt
27+
pip install -r requirements/check-style.txt
28+
pip install -e .
29+
- name: Check docs build
30+
run: |
2631
linkcheckMarkdown docs/ -v -r
2732
linkcheckMarkdown README.md -v -r
2833
linkcheckMarkdown CHANGELOG.md -v -r
2934
cd docs
3035
mkdocs build --strict
3136
- name: Check docs examples
3237
run: |
33-
pip install -r requirements/check-types.txt
34-
pip install -r requirements/check-style.txt
3538
mypy --show-error-codes docs/examples/python/
3639
ruff check docs/examples/python/

docs/examples/python/route-parameters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from reactpy import component, html, run
44

5-
from reactpy_router import browser_router, link, route
6-
from reactpy_router.core import use_params
5+
from reactpy_router import browser_router, link, route, use_params
76

87
message_data: list["MessageDataType"] = [
98
{"id": 1, "with": ["Alice"], "from": None, "message": "Hello!"},

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ plugins:
9696
- https://reactpy.dev/docs/objects.inv
9797
- https://installer.readthedocs.io/en/stable/objects.inv
9898
options:
99-
show_root_heading: true
10099
show_bases: false
100+
show_root_members_full_path: true
101101
extra:
102102
generator: false
103103
version:

docs/src/learn/hooks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Several pre-fabricated hooks are provided to help integrate with routing feature
88

99
## Use Search Parameters
1010

11-
The [`use_search_params`][src.reactpy_router.use_search_params] hook can be used to access query parameters from the current location. It returns a dictionary of query parameters, where each value is a list of strings.
11+
The [`use_search_params`][reactpy_router.use_search_params] hook can be used to access query parameters from the current location. It returns a dictionary of query parameters, where each value is a list of strings.
1212

1313
=== "components.py"
1414

@@ -18,7 +18,7 @@ The [`use_search_params`][src.reactpy_router.use_search_params] hook can be used
1818

1919
## Use Parameters
2020

21-
The [`use_params`][src.reactpy_router.use_params] hook can be used to access route parameters from the current location. It returns a dictionary of route parameters, where each value is mapped to a value that matches the type specified in the route path.
21+
The [`use_params`][reactpy_router.use_params] hook can be used to access route parameters from the current location. It returns a dictionary of route parameters, where each value is mapped to a value that matches the type specified in the route path.
2222

2323
=== "components.py"
2424

docs/src/learn/routers-routes-and-links.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We include built-in components that automatically handle routing, which enable S
44

55
## Routers and Routes
66

7-
The [`browser_router`][src.reactpy_router.browser_router] component is one possible implementation of a [Router][src.reactpy_router.types.Router]. Routers takes a series of [route][src.reactpy_router.route] objects as positional arguments and render whatever element matches the current location.
7+
The [`browser_router`][reactpy_router.browser_router] component is one possible implementation of a [Router][reactpy_router.types.Router]. Routers takes a series of [route][reactpy_router.route] objects as positional arguments and render whatever element matches the current location.
88

99
!!! abstract "Note"
1010

@@ -23,7 +23,7 @@ Here we'll note some special syntax in the route path for the second route. The
2323

2424
### Browser Router
2525

26-
The syntax for declaring routes with the [`browser_router`][src.reactpy_router.browser_router] is very similar to the syntax used by [`starlette`](https://www.starlette.io/routing/) (a popular Python web framework). As such route parameters are declared using the following syntax:
26+
The syntax for declaring routes with the [`browser_router`][reactpy_router.browser_router] is very similar to the syntax used by [`starlette`](https://www.starlette.io/routing/) (a popular Python web framework). As such route parameters are declared using the following syntax:
2727

2828
```python linenums="0"
2929
/my/route/{param}
@@ -56,11 +56,11 @@ Any route parameters collected from the current location then be accessed using
5656

5757
!!! warning "Pitfall"
5858

59-
While it is possible to use route parameters to capture values from query strings (such as `#!python /my/route/?foo={bar}`), this is not recommended. Instead, you should use the [`use_search_params`][src.reactpy_router.use_search_params] hook to access query string values.
59+
While it is possible to use route parameters to capture values from query strings (such as `#!python /my/route/?foo={bar}`), this is not recommended. Instead, you should use the [`use_search_params`][reactpy_router.use_search_params] hook to access query string values.
6060

6161
## Route Links
6262

63-
Links between routes should be created using the [link][src.reactpy_router.link] component. This will allow ReactPy to handle the transition between routes and avoid a page reload.
63+
Links between routes should be created using the [link][reactpy_router.link] component. This will allow ReactPy to handle the transition between routes and avoid a page reload.
6464

6565
=== "components.py"
6666

docs/src/learn/your-first-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p class="intro" markdown>
22

3-
Here you'll learn the various features of `reactpy-router` and how to use them. These examples will utilize the [`reactpy_router.browser_router`][src.reactpy_router.browser_router].
3+
Here you'll learn the various features of `reactpy-router` and how to use them. These examples will utilize the [`reactpy_router.browser_router`][reactpy_router.browser_router].
44

55
</p>
66

docs/src/reference/components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
::: src.reactpy_router
1+
::: reactpy_router
22

33
options:
44
members: ["route", "link"]

docs/src/reference/hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
::: src.reactpy_router
1+
::: reactpy_router
22

33
options:
44
members: ["use_params", "use_search_params"]

docs/src/reference/router.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
::: src.reactpy_router
1+
::: reactpy_router
22

33
options:
44
members: ["browser_router"]

docs/src/reference/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
::: src.reactpy_router.types
1+
::: reactpy_router.types

0 commit comments

Comments
 (0)