Skip to content

Commit

Permalink
docs: Show curly braces in API docs correctly #1880 (#2027)
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-mihok authored Jun 19, 2023
1 parent 6c8e916 commit 570127b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion py/h2o_lightwave/h2o_lightwave/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def on(arg: str = None, predicate: Optional[Callable] = None):
A function annotated with `@on('foo.bar', lambda x: 42 <= x <= 420)` is invoked whenever `q.events.foo.bar` between 42 and 420.
A function annotated with `@on('#foo')` is invoked whenever `q.args['#']` equals 'foo'.
A function annotated with `@on('#foo/bar')` is invoked whenever `q.args['#']` equals 'foo/bar'.
A function annotated with `@on('#foo/&lcub;fruit&rcub;')` is invoked whenever `q.args['#']` matches 'foo/apple', 'foo/orange', etc. The parameter 'fruit' is passed to the function (in this case, 'apple', 'orange', etc.)
A function annotated with `@on('#foo/{"{fruit}"}')` is invoked whenever `q.args['#']` matches 'foo/apple', 'foo/orange', etc. The parameter 'fruit' is passed to the function (in this case, 'apple', 'orange', etc.)
Parameters in patterns (indicated within curly braces) can be converted to `str`, `int`, `float` or `uuid.UUID` instances by suffixing the parameters with `str`, `int`, `float` or `uuid`, respectively.
Expand Down
2 changes: 1 addition & 1 deletion py/h2o_wave/h2o_wave/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def on(arg: str = None, predicate: Optional[Callable] = None):
A function annotated with `@on('foo.bar', lambda x: 42 <= x <= 420)` is invoked whenever `q.events.foo.bar` between 42 and 420.
A function annotated with `@on('#foo')` is invoked whenever `q.args['#']` equals 'foo'.
A function annotated with `@on('#foo/bar')` is invoked whenever `q.args['#']` equals 'foo/bar'.
A function annotated with `@on('#foo/&lcub;fruit&rcub;')` is invoked whenever `q.args['#']` matches 'foo/apple', 'foo/orange', etc. The parameter 'fruit' is passed to the function (in this case, 'apple', 'orange', etc.)
A function annotated with `@on('#foo/{"{fruit}"}')` is invoked whenever `q.args['#']` matches 'foo/apple', 'foo/orange', etc. The parameter 'fruit' is passed to the function (in this case, 'apple', 'orange', etc.)
Parameters in patterns (indicated within curly braces) can be converted to `str`, `int`, `float` or `uuid.UUID` instances by suffixing the parameters with `str`, `int`, `float` or `uuid`, respectively.
Expand Down

0 comments on commit 570127b

Please sign in to comment.