]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
📝 Update includes in `docs/en/docs/how-to/custom-docs-ui-assets.md` (#12557)
authorPhilip Okiokio <55271518+philipokiokio@users.noreply.github.com>
Sun, 27 Oct 2024 22:53:46 +0000 (23:53 +0100)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2024 22:53:46 +0000 (22:53 +0000)
docs/en/docs/how-to/custom-docs-ui-assets.md

index 16c873d1152a59836c0a5e0c8c9168f7699401ea..abcccb499cc25b5f50c6568224e264cd63ee62ad 100644 (file)
@@ -18,9 +18,7 @@ The first step is to disable the automatic docs, as by default, those use the de
 
 To disable them, set their URLs to `None` when creating your `FastAPI` app:
 
-```Python hl_lines="8"
-{!../../docs_src/custom_docs_ui/tutorial001.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial001.py hl[8] *}
 
 ### Include the custom docs
 
@@ -36,9 +34,7 @@ You can reuse FastAPI's internal functions to create the HTML pages for the docs
 
 And similarly for ReDoc...
 
-```Python hl_lines="2-6  11-19  22-24  27-33"
-{!../../docs_src/custom_docs_ui/tutorial001.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial001.py hl[2:6,11:19,22:24,27:33] *}
 
 /// tip
 
@@ -54,9 +50,7 @@ Swagger UI will handle it behind the scenes for you, but it needs this "redirect
 
 Now, to be able to test that everything works, create a *path operation*:
 
-```Python hl_lines="36-38"
-{!../../docs_src/custom_docs_ui/tutorial001.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial001.py hl[36:38] *}
 
 ### Test it
 
@@ -158,9 +152,7 @@ The same as when using a custom CDN, the first step is to disable the automatic
 
 To disable them, set their URLs to `None` when creating your `FastAPI` app:
 
-```Python hl_lines="9"
-{!../../docs_src/custom_docs_ui/tutorial002.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial002.py hl[9] *}
 
 ### Include the custom docs for static files
 
@@ -176,9 +168,7 @@ Again, you can reuse FastAPI's internal functions to create the HTML pages for t
 
 And similarly for ReDoc...
 
-```Python hl_lines="2-6  14-22  25-27  30-36"
-{!../../docs_src/custom_docs_ui/tutorial002.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial002.py hl[2:6,14:22,25:27,30:36] *}
 
 /// tip
 
@@ -194,9 +184,7 @@ Swagger UI will handle it behind the scenes for you, but it needs this "redirect
 
 Now, to be able to test that everything works, create a *path operation*:
 
-```Python hl_lines="39-41"
-{!../../docs_src/custom_docs_ui/tutorial002.py!}
-```
+{* ../../docs_src/custom_docs_ui/tutorial002.py hl[39:41] *}
 
 ### Test Static Files UI