Browse Source

fix zh docs's markdown syntax error

pull/12208/head
xiongxinlei 9 months ago
parent
commit
0f102ce0ef
  1. 4
      docs/zh/docs/async.md
  2. 2
      docs/zh/docs/python-types.md
  3. 2
      docs/zh/docs/tutorial/body.md
  4. 4
      docs/zh/docs/tutorial/index.md
  5. 2
      docs/zh/docs/tutorial/path-params.md

4
docs/zh/docs/async.md

@ -56,7 +56,7 @@ def results():
## 技术细节
Python 的现代版本支持通过一种叫**"协程"**——使用 `async``await` 语法的东西来写**”异步代码“**。
Python 的现代版本支持通过一种叫 **"协程"** ——使用 `async``await` 语法的东西来写 **"异步代码"**。
让我们在下面的部分中逐一介绍:
@ -413,7 +413,7 @@ Starlette (和 **FastAPI**) 是基于 <a href="https://anyio.readthedocs.io/
### 路径操作函数
当你使用 `def` 而不是 `async def` 来声明一个*路径操作函数*时,它运行在外部的线程池中并等待其结果,而不是直接调用(因为它会阻塞服务器)。
当你使用 `def` 而不是 `async def` 来声明一个 **路径操作函数** 时,它运行在外部的线程池中并等待其结果,而不是直接调用(因为它会阻塞服务器)。
如果您使用过另一个不以上述方式工作的异步框架,并且您习惯于用普通的 `def` 定义普通的仅计算路径操作函数,以获得微小的性能增益(大约100纳秒),请注意,在 FastAPI 中,效果将完全相反。在这些情况下,最好使用 `async def`,除非路径操作函数内使用执行阻塞 <abbr title="输入/输出:磁盘读写,网络通讯.">I/O</abbr> 的代码。

2
docs/zh/docs/python-types.md

@ -242,7 +242,7 @@ John Doe
<a href="https://docs.pydantic.dev/" class="external-link" target="_blank">Pydantic</a> 是一个用来用来执行数据校验的 Python 库。
你可以将数据的"结构"声明为具有属性的类。
你可以将数据的 **"结构"** 声明为具有属性的类。
每个属性都拥有类型。

2
docs/zh/docs/tutorial/body.md

@ -2,7 +2,7 @@
FastAPI 使用 **请求体** 从客户端(例如浏览器)向 API 发送数据。
**请求体**是客户端发送给 API 的数据。**响应体**是 API 发送给客户端的数据。
**请求体** 是客户端发送给 API 的数据。**响应体** `API` 发送给客户端的数据。
API 基本上肯定要发送 **响应体**,但是客户端不一定发送 **请求体**

4
docs/zh/docs/tutorial/index.md

@ -58,13 +58,13 @@ $ pip install "fastapi[all]"
假如你想将应用程序部署到生产环境,你可能要执行以下操作:
```
``` shell
pip install fastapi
```
并且安装`uvicorn`来作为服务器:
```
``` shell
pip install "uvicorn[standard]"
```

2
docs/zh/docs/tutorial/path-params.md

@ -157,7 +157,7 @@ Python 3.4 及之后版本支持<a href="https://docs.python.org/3/library/enum.
### 声明 *路径参数*
使用 Enum 类(`ModelName`)创建使用类型注解的*路径参数*:
使用 `Enum` 类(`ModelName`)创建使用类型注解的 *路径参数*
```Python hl_lines="16"
{!../../../docs_src/path_params/tutorial005.py!}

Loading…
Cancel
Save