Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b90944

Browse files
author
Patrick Wehbe
committed
πŸ“ Fix out-of-range highlight lines in docs code embeds
Three docs `{* file hl[a:b] *}` embeds set the inclusive upper bound one line past the end of the referenced file: - `advanced/response-headers.md`: `hl[10:12]` -> `hl[10:11]` (`docs_src/response_headers/tutorial001_py310.py` is 11 lines) - `advanced/websockets.md`: `hl[48:52]` -> `hl[48:51]` (`docs_src/websockets_/tutorial001_py310.py` is 51 lines) - `tutorial/body-updates.md`: `hl[28:33]` -> `hl[28:32]` (`docs_src/body_updates/tutorial001_py310.py` is 32 lines) The rendered output is unchanged since the nonexistent trailing line was silently dropped; this corrects the ranges to the intended last line.
1 parent 0cb4a8e commit 6b90944

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

β€Ždocs/en/docs/advanced/response-headers.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can also add headers when you return a `Response` directly.
2222

2323
Create a response as described in [Return a Response Directly](response-directly.md) and pass the headers as an additional parameter:
2424

25-
{* ../../docs_src/response_headers/tutorial001_py310.py hl[10:12] *}
25+
{* ../../docs_src/response_headers/tutorial001_py310.py hl[10:11] *}
2626

2727
/// note | Technical Details
2828

β€Ždocs/en/docs/advanced/websockets.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ You could also use `from starlette.websockets import WebSocket`.
5858

5959
In your WebSocket route you can `await` for messages and send messages.
6060

61-
{* ../../docs_src/websockets_/tutorial001_py310.py hl[48:52] *}
61+
{* ../../docs_src/websockets_/tutorial001_py310.py hl[48:51] *}
6262

6363
You can receive and send binary, text, and JSON data.
6464

β€Ždocs/en/docs/tutorial/body-updates.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To update an item you can use the [HTTP `PUT`](https://developer.mozilla.org/en-
66

77
You can use the `jsonable_encoder` to convert the input data to data that can be stored as JSON (e.g. with a NoSQL database). For example, converting `datetime` to `str`.
88

9-
{* ../../docs_src/body_updates/tutorial001_py310.py hl[28:33] *}
9+
{* ../../docs_src/body_updates/tutorial001_py310.py hl[28:32] *}
1010

1111
`PUT` is used to receive data that should replace the existing data.
1212

0 commit comments

Comments
Β (0)