]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update includes for `docs/en/docs/tutorial/dependencies/sub-dependencies.md` (...
authorBaldeep Singh Handa <handabaldeep@gmail.com>
Sat, 9 Nov 2024 15:21:30 +0000 (15:21 +0000)
committerGitHub <noreply@github.com>
Sat, 9 Nov 2024 15:21:30 +0000 (15:21 +0000)
docs/en/docs/tutorial/dependencies/sub-dependencies.md

index 2b098d1592db12d781c61dde8fb90e14b2ca06a2..1f8ba420a1cb91eee5d29733fd811835a3a3c638 100644 (file)
@@ -10,57 +10,7 @@ They can be as **deep** as you need them to be.
 
 You could create a first dependency ("dependable") like:
 
-//// tab | Python 3.10+
-
-```Python hl_lines="8-9"
-{!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
-```
-
-////
-
-//// tab | Python 3.9+
-
-```Python hl_lines="8-9"
-{!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="9-10"
-{!> ../../docs_src/dependencies/tutorial005_an.py!}
-```
-
-////
-
-//// tab | Python 3.10 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="6-7"
-{!> ../../docs_src/dependencies/tutorial005_py310.py!}
-```
-
-////
-
-//// tab | Python 3.8 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="8-9"
-{!> ../../docs_src/dependencies/tutorial005.py!}
-```
-
-////
+{* ../../docs_src/dependencies/tutorial005_an_py310.py hl[8:9] *}
 
 It declares an optional query parameter `q` as a `str`, and then it just returns it.
 
@@ -70,57 +20,7 @@ This is quite simple (not very useful), but will help us focus on how the sub-de
 
 Then you can create another dependency function (a "dependable") that at the same time declares a dependency of its own (so it is a "dependant" too):
 
-//// tab | Python 3.10+
-
-```Python hl_lines="13"
-{!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
-```
-
-////
-
-//// tab | Python 3.9+
-
-```Python hl_lines="13"
-{!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="14"
-{!> ../../docs_src/dependencies/tutorial005_an.py!}
-```
-
-////
-
-//// tab | Python 3.10 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="11"
-{!> ../../docs_src/dependencies/tutorial005_py310.py!}
-```
-
-////
-
-//// tab | Python 3.8 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="13"
-{!> ../../docs_src/dependencies/tutorial005.py!}
-```
-
-////
+{* ../../docs_src/dependencies/tutorial005_an_py310.py hl[13] *}
 
 Let's focus on the parameters declared:
 
@@ -133,57 +33,7 @@ Let's focus on the parameters declared:
 
 Then we can use the dependency with:
 
-//// tab | Python 3.10+
-
-```Python hl_lines="23"
-{!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
-```
-
-////
-
-//// tab | Python 3.9+
-
-```Python hl_lines="23"
-{!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
-```
-
-////
-
-//// tab | Python 3.8+
-
-```Python hl_lines="24"
-{!> ../../docs_src/dependencies/tutorial005_an.py!}
-```
-
-////
-
-//// tab | Python 3.10 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="19"
-{!> ../../docs_src/dependencies/tutorial005_py310.py!}
-```
-
-////
-
-//// tab | Python 3.8 non-Annotated
-
-/// tip
-
-Prefer to use the `Annotated` version if possible.
-
-///
-
-```Python hl_lines="22"
-{!> ../../docs_src/dependencies/tutorial005.py!}
-```
-
-////
+{* ../../docs_src/dependencies/tutorial005_an_py310.py hl[23] *}
 
 /// info