@@ -107,12 +107,12 @@ app = app()
107107
108108This produces the following route table:
109109
110- | URL Path | Matched Element | Params |
111- | ---------------- | --------------- | ------------------------ |
112- | ` / ` | ` dashboard ` | ` {} ` |
113- | ` /users ` | ` user_page ` | ` {} ` |
114- | ` /users/42 ` | ` user_page ` | ` { "user_id": "42"} ` |
115- | ` /anything-else ` | ` not_found ` | ` { "*": "anything-else"} ` |
110+ | URL Path | Matched Element | Params |
111+ | ---------------- | --------------- | ------------------------- |
112+ | ` / ` | ` dashboard ` | none |
113+ | ` /users ` | ` user_page ` | none |
114+ | ` /users/42 ` | ` user_page ` | ` "user_id" ` = ` "42" ` |
115+ | ` /anything-else ` | ` not_found ` | ` "*" ` = ` "anything-else" ` |
116116
117117## Recommendations
118118
@@ -146,11 +146,17 @@ This produces the following route table:
146146
147147#### Path patterns
148148
149- - ` {var_name} ` : Required dynamic segment
150- - ` {var_name?} ` : Optional dynamic segment (matches zero or one segments)
151- - ` * ` : Wildcard, matches any remaining path segments
152- - Static text: Exact match
149+ ``` python skip-test
150+ {var_name} # Required dynamic segment
151+ {var_name? } # Optional dynamic segment (matches zero or one segments)
152+ * # Wildcard, matches any remaining path segments
153+ segment # Static text: Exact match
154+ ```
153155
154156See [ ` use_params ` ] ( ../hooks/use_params.md ) for more details on route parameters.
155157
156- Child paths are appended to parent paths. For example, ` ui.route(ui.route(path="{user_id}"), path="users") ` produces ` /users/{user_id} ` .
158+ Child paths are appended to parent paths. For example:
159+
160+ ``` python skip-test
161+ ui.route(ui.route(path = " {user_id} " ), path = " users" ) # produces /users/{user_id}
162+ ```
0 commit comments