]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
馃摑 Update includes syntax for `docs/pl/docs/tutorial/first-steps.md` (#12584)
authorSebastian Koz艂owski <82809231+sebkozlo@users.noreply.github.com>
Sun, 27 Oct 2024 16:51:30 +0000 (17:51 +0100)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2024 16:51:30 +0000 (16:51 +0000)
docs/pl/docs/tutorial/first-steps.md

index 99c425f12b45255ba4bd8439e357c5d9ddc6e5da..9466ca84d1bedf6dc7f98d2a72790410351851e7 100644 (file)
@@ -2,9 +2,7 @@
 
 Najprostszy plik FastAPI mo偶e wygl膮da膰 tak:
 
-```Python
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{* ../../docs_src/first_steps/tutorial001.py *}
 
 Skopiuj to do pliku `main.py`.
 
@@ -133,9 +131,7 @@ Mo偶esz go r贸wnie偶 u偶y膰 do automatycznego generowania kodu dla klient贸w, kt
 
 ### Krok 1: zaimportuj `FastAPI`
 
-```Python hl_lines="1"
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{* ../../docs_src/first_steps/tutorial001.py hl[1] *}
 
 `FastAPI` jest klas膮, kt贸ra zapewnia wszystkie funkcjonalno艣ci Twojego API.
 
@@ -149,9 +145,7 @@ Oznacza to, 偶e mo偶esz korzysta膰 ze wszystkich funkcjonalno艣ci <a href="https
 
 ### Krok 2: utw贸rz instancj臋 `FastAPI`
 
-```Python hl_lines="3"
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{*../../docs_src/first_steps/tutorial001.py hl[3] *}
 
 Zmienna `app` b臋dzie tutaj "instancj膮" klasy `FastAPI`.
 
@@ -171,9 +165,7 @@ $ uvicorn main:app --reload
 
 Je艣li stworzysz swoj膮 aplikacj臋, np.:
 
-```Python hl_lines="3"
-{!../../docs_src/first_steps/tutorial002.py!}
-```
+{* ../../docs_src/first_steps/tutorial002.py hl[3] *}
 
 I umie艣cisz to w pliku `main.py`, to b臋dziesz m贸g艂 tak wywo艂a膰 `uvicorn`:
 
@@ -250,9 +242,7 @@ B臋dziemy je r贸wnie偶 nazywali "**operacjami**".
 
 #### Zdefiniuj *dekorator operacji na 艣cie偶ce*
 
-```Python hl_lines="6"
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{* ../../docs_src/first_steps/tutorial001.py hl[6] *}
 
 `@app.get("/")` m贸wi **FastAPI** 偶e funkcja poni偶ej odpowiada za obs艂ug臋 偶膮da艅, kt贸re trafiaj膮 do:
 
@@ -306,9 +296,7 @@ To jest nasza "**funkcja obs艂uguj膮ca 艣cie偶k臋**":
 * **operacja**: to `get`.
 * **funkcja**: to funkcja poni偶ej "dekoratora" (poni偶ej `@app.get("/")`).
 
-```Python hl_lines="7"
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{* ../../docs_src/first_steps/tutorial001.py hl[7] *}
 
 Jest to funkcja Python.
 
@@ -320,9 +308,7 @@ W tym przypadku jest to funkcja "asynchroniczna".
 
 Mo偶esz r贸wnie偶 zdefiniowa膰 to jako normaln膮 funkcj臋 zamiast `async def`:
 
-```Python hl_lines="7"
-{!../../docs_src/first_steps/tutorial003.py!}
-```
+{* ../../docs_src/first_steps/tutorial003.py hl[7] *}
 
 /// note
 
@@ -332,9 +318,7 @@ Je艣li nie znasz r贸偶nicy, sprawd藕 [Async: *"In a hurry?"*](../async.md#in-a-h
 
 ### Krok 5: zwr贸膰 zawarto艣膰
 
-```Python hl_lines="8"
-{!../../docs_src/first_steps/tutorial001.py!}
-```
+{* ../../docs_src/first_steps/tutorial001.py hl[8] *}
 
 Mo偶esz zwr贸ci膰 `dict`, `list`, pojedyncz膮 warto艣膰 jako `str`, `int`, itp.