Skip to content

Commit ca76a4e

Browse files
YuriiMotovgithub-actions[bot]tiangolo
authored
📝 Use dfn tag for definitions instead of abbr in docs (fastapi#14744)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
1 parent 1133a45 commit ca76a4e

23 files changed

Lines changed: 57 additions & 52 deletions

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The key features are:
3434
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).
3535
* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *
3636
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
37-
* **Intuitive**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
37+
* **Intuitive**: Great editor support. <dfn title="also known as auto-complete, autocompletion, IntelliSense">Completion</dfn> everywhere. Less time debugging.
3838
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
3939
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
4040
* **Robust**: Get production-ready code. With automatic interactive documentation.
@@ -371,15 +371,15 @@ item: Item
371371
* Validation of data:
372372
* Automatic and clear errors when the data is invalid.
373373
* Validation even for deeply nested JSON objects.
374-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
374+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of input data: coming from the network to Python data and types. Reading from:
375375
* JSON.
376376
* Path parameters.
377377
* Query parameters.
378378
* Cookies.
379379
* Headers.
380380
* Forms.
381381
* Files.
382-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of output data: converting from Python data and types to network data (as JSON):
382+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of output data: converting from Python data and types to network data (as JSON):
383383
* Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
384384
* `datetime` objects.
385385
* `UUID` objects.
@@ -442,7 +442,7 @@ For a more complete example including more features, see the <a href="https://fa
442442

443443
* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
444444
* How to set **validation constraints** as `maximum_length` or `regex`.
445-
* A very powerful and easy to use **<abbr title="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
445+
* A very powerful and easy to use **<dfn title="also known as components, resources, providers, services, injectables">Dependency Injection</dfn>** system.
446446
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
447447
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
448448
* **GraphQL** integration with <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> and other libraries.
@@ -527,7 +527,7 @@ Used by Starlette:
527527

528528
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Required if you want to use the `TestClient`.
529529
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
530-
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>, with `request.form()`.
530+
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <dfn title="converting the string that comes from an HTTP request into Python data">"parsing"</dfn>, with `request.form()`.
531531

532532
Used by FastAPI:
533533

docs/en/docs/advanced/dataclasses.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ In that case, you can simply swap the standard `dataclasses` with `pydantic.data
6464

6565
6. Here we are returning a dictionary that contains `items` which is a list of dataclasses.
6666

67-
FastAPI is still capable of <abbr title="converting the data to a format that can be transmitted">serializing</abbr> the data to JSON.
67+
FastAPI is still capable of <dfn title="converting the data to a format that can be transmitted">serializing</dfn> the data to JSON.
6868

6969
7. Here the `response_model` is using a type annotation of a list of `Author` dataclasses.
7070

docs/en/docs/advanced/path-operation-advanced-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ You could do that with `openapi_extra`:
141141

142142
{* ../../docs_src/path_operation_advanced_configuration/tutorial006_py39.py hl[19:36, 39:40] *}
143143

144-
In this example, we didn't declare any Pydantic model. In fact, the request body is not even <abbr title="converted from some plain format, like bytes, into Python objects">parsed</abbr> as JSON, it is read directly as `bytes`, and the function `magic_data_reader()` would be in charge of parsing it in some way.
144+
In this example, we didn't declare any Pydantic model. In fact, the request body is not even <dfn title="converted from some plain format, like bytes, into Python objects">parsed</dfn> as JSON, it is read directly as `bytes`, and the function `magic_data_reader()` would be in charge of parsing it in some way.
145145

146146
Nevertheless, we can declare the expected schema for the request body.
147147

docs/en/docs/alternatives.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,15 @@ There are several Flask REST frameworks, but after investing the time and work i
137137

138138
### <a href="https://marshmallow.readthedocs.io/en/stable/" class="external-link" target="_blank">Marshmallow</a> { #marshmallow }
139139

140-
One of the main features needed by API systems is data "<abbr title="also called marshalling, conversion">serialization</abbr>" which is taking data from the code (Python) and converting it into something that can be sent through the network. For example, converting an object containing data from a database into a JSON object. Converting `datetime` objects into strings, etc.
140+
One of the main features needed by API systems is data "<dfn title="also called marshalling, conversion">serialization</dfn>" which is taking data from the code (Python) and converting it into something that can be sent through the network. For example, converting an object containing data from a database into a JSON object. Converting `datetime` objects into strings, etc.
141141

142142
Another big feature needed by APIs is data validation, making sure that the data is valid, given certain parameters. For example, that some field is an `int`, and not some random string. This is especially useful for incoming data.
143143

144144
Without a data validation system, you would have to do all the checks by hand, in code.
145145

146146
These features are what Marshmallow was built to provide. It is a great library, and I have used it a lot before.
147147

148-
But it was created before there existed Python type hints. So, to define every <abbr title="the definition of how data should be formed">schema</abbr> you need to use specific utils and classes provided by Marshmallow.
148+
But it was created before there existed Python type hints. So, to define every <dfn title="the definition of how data should be formed">schema</dfn> you need to use specific utils and classes provided by Marshmallow.
149149

150150
/// check | Inspired **FastAPI** to
151151

@@ -155,7 +155,7 @@ Use code to define "schemas" that provide data types and validation, automatical
155155

156156
### <a href="https://webargs.readthedocs.io/en/latest/" class="external-link" target="_blank">Webargs</a> { #webargs }
157157

158-
Another big feature required by APIs is <abbr title="reading and converting to Python data">parsing</abbr> data from incoming requests.
158+
Another big feature required by APIs is <dfn title="reading and converting to Python data">parsing</dfn> data from incoming requests.
159159

160160
Webargs is a tool that was made to provide that on top of several frameworks, including Flask.
161161

@@ -419,7 +419,7 @@ Handle all the data validation, data serialization and automatic model documenta
419419

420420
### <a href="https://www.starlette.dev/" class="external-link" target="_blank">Starlette</a> { #starlette }
421421

422-
Starlette is a lightweight <abbr title="The new standard for building asynchronous Python web applications">ASGI</abbr> framework/toolkit, which is ideal for building high-performance asyncio services.
422+
Starlette is a lightweight <dfn title="The new standard for building asynchronous Python web applications">ASGI</dfn> framework/toolkit, which is ideal for building high-performance asyncio services.
423423

424424
It is very simple and intuitive. It's designed to be easily extensible, and have modular components.
425425

docs/en/docs/css/custom.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,8 @@ Inspired by Termynal's CSS tricks with modifications
203203
-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
204204
box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;
205205
}
206+
207+
.md-typeset dfn {
208+
border-bottom: .05rem dotted var(--md-default-fg-color--light);
209+
cursor: help;
210+
}

docs/en/docs/deployment/docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Without using containers, making applications run on startup and with restarts c
454454

455455
## Replication - Number of Processes { #replication-number-of-processes }
456456

457-
If you have a <abbr title="A group of machines that are configured to be connected and work together in some way.">cluster</abbr> of machines with **Kubernetes**, Docker Swarm Mode, Nomad, or another similar complex system to manage distributed containers on multiple machines, then you will probably want to **handle replication** at the **cluster level** instead of using a **process manager** (like Uvicorn with workers) in each container.
457+
If you have a <dfn title="A group of machines that are configured to be connected and work together in some way.">cluster</dfn> of machines with **Kubernetes**, Docker Swarm Mode, Nomad, or another similar complex system to manage distributed containers on multiple machines, then you will probably want to **handle replication** at the **cluster level** instead of using a **process manager** (like Uvicorn with workers) in each container.
458458

459459
One of those distributed container management systems like Kubernetes normally has some integrated way of handling **replication of containers** while still supporting **load balancing** for the incoming requests. All at the **cluster level**.
460460

docs/en/docs/deployment/https.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Here's an example of how an HTTPS API could look like, step by step, paying atte
6565

6666
It would probably all start by you **acquiring** some **domain name**. Then, you would configure it in a DNS server (possibly your same cloud provider).
6767

68-
You would probably get a cloud server (a virtual machine) or something similar, and it would have a <abbr title="That doesn't change">fixed</abbr> **public IP address**.
68+
You would probably get a cloud server (a virtual machine) or something similar, and it would have a <dfn title="Doesn't change over time. Not dynamic.">fixed</dfn> **public IP address**.
6969

7070
In the DNS server(s) you would configure a record (an "`A record`") to point **your domain** to the public **IP address of your server**.
7171

docs/en/docs/features.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### Based on open standards { #based-on-open-standards }
88

9-
* <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> for API creation, including declarations of <abbr title="also known as: endpoints, routes">path</abbr> <abbr title="also known as HTTP methods, as POST, GET, PUT, DELETE">operations</abbr>, parameters, request bodies, security, etc.
9+
* <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> for API creation, including declarations of <dfn title="also known as: endpoints, routes">path</dfn> <dfn title="also known as HTTP methods, as POST, GET, PUT, DELETE">operations</dfn>, parameters, request bodies, security, etc.
1010
* Automatic data model documentation with <a href="https://json-schema.org/" class="external-link" target="_blank"><strong>JSON Schema</strong></a> (as OpenAPI itself is based on JSON Schema).
1111
* Designed around these standards, after a meticulous study. Instead of an afterthought layer on top.
1212
* This also allows using automatic **client code generation** in many languages.
@@ -136,7 +136,7 @@ All built as reusable tools and components that are easy to integrate with your
136136

137137
### Dependency Injection { #dependency-injection }
138138

139-
FastAPI includes an extremely easy to use, but extremely powerful <abbr title='also known as "components", "resources", "services", "providers"'><strong>Dependency Injection</strong></abbr> system.
139+
FastAPI includes an extremely easy to use, but extremely powerful <dfn title='also known as "components", "resources", "services", "providers"'><strong>Dependency Injection</strong></dfn> system.
140140

141141
* Even dependencies can have dependencies, creating a hierarchy or **"graph" of dependencies**.
142142
* All **automatically handled** by the framework.
@@ -153,8 +153,8 @@ Any integration is designed to be so simple to use (with dependencies) that you
153153

154154
### Tested { #tested }
155155

156-
* 100% <abbr title="The amount of code that is automatically tested">test coverage</abbr>.
157-
* 100% <abbr title="Python type annotations, with this your editor and external tools can give you better support">type annotated</abbr> code base.
156+
* 100% <dfn title="The amount of code that is automatically tested">test coverage</dfn>.
157+
* 100% <dfn title="Python type annotations, with this your editor and external tools can give you better support">type annotated</dfn> code base.
158158
* Used in production applications.
159159

160160
## Starlette features { #starlette-features }
@@ -190,7 +190,7 @@ With **FastAPI** you get all of **Pydantic**'s features (as FastAPI is based on
190190
* **No brainfuck**:
191191
* No new schema definition micro-language to learn.
192192
* If you know Python types you know how to use Pydantic.
193-
* Plays nicely with your **<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>/<abbr title="A program that checks for code errors">linter</abbr>/brain**:
193+
* Plays nicely with your **<abbr title="Integrated Development Environment: similar to a code editor">IDE</abbr>/<dfn title="A program that checks for code errors">linter</dfn>/brain**:
194194
* Because pydantic data structures are just instances of classes you define; auto-completion, linting, mypy and your intuition should all work properly with your validated data.
195195
* Validate **complex structures**:
196196
* Use of hierarchical Pydantic models, Python `typing`’s `List` and `Dict`, etc.

docs/en/docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The key features are:
4040
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).
4141
* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *
4242
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
43-
* **Intuitive**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
43+
* **Intuitive**: Great editor support. <dfn title="also known as auto-complete, autocompletion, IntelliSense">Completion</dfn> everywhere. Less time debugging.
4444
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
4545
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
4646
* **Robust**: Get production-ready code. With automatic interactive documentation.
@@ -368,15 +368,15 @@ item: Item
368368
* Validation of data:
369369
* Automatic and clear errors when the data is invalid.
370370
* Validation even for deeply nested JSON objects.
371-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
371+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of input data: coming from the network to Python data and types. Reading from:
372372
* JSON.
373373
* Path parameters.
374374
* Query parameters.
375375
* Cookies.
376376
* Headers.
377377
* Forms.
378378
* Files.
379-
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of output data: converting from Python data and types to network data (as JSON):
379+
* <dfn title="also known as: serialization, parsing, marshalling">Conversion</dfn> of output data: converting from Python data and types to network data (as JSON):
380380
* Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
381381
* `datetime` objects.
382382
* `UUID` objects.
@@ -439,7 +439,7 @@ For a more complete example including more features, see the <a href="https://fa
439439

440440
* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
441441
* How to set **validation constraints** as `maximum_length` or `regex`.
442-
* A very powerful and easy to use **<abbr title="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
442+
* A very powerful and easy to use **<dfn title="also known as components, resources, providers, services, injectables">Dependency Injection</dfn>** system.
443443
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
444444
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
445445
* **GraphQL** integration with <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> and other libraries.
@@ -524,7 +524,7 @@ Used by Starlette:
524524

525525
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Required if you want to use the `TestClient`.
526526
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
527-
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>, with `request.form()`.
527+
* <a href="https://github.com/Kludex/python-multipart" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <dfn title="converting the string that comes from an HTTP request into Python data">"parsing"</dfn>, with `request.form()`.
528528

529529
Used by FastAPI:
530530

0 commit comments

Comments
 (0)