diff --git a/docs/async.md b/docs/async.md
index f77fcafa4..1c7bebf3a 100644
--- a/docs/async.md
+++ b/docs/async.md
@@ -14,20 +14,21 @@ results = await some_library()
Then, declare your endpoint functions with `async def` like:
-```Python
+```Python hl_lines="2"
@app.get('/')
async def read_results():
results = await some_library()
return results
```
-**Note**: You can only use `await` inside of functions created with `async def`.
+!!! note
+ You can only use `await` inside of functions created with `async def`.
---
If you are using a third party library that communicates with something (a database, an API, the file system, etc) and doesn't have support for using `await`, (this is currently the case for most database libraries), then declare your endpoint functions as normally, with just `def`, like:
-```Python
+```Python hl_lines="2"
@app.get('/')
def results():
results = some_library()
@@ -283,7 +284,7 @@ The key here is the `await`. It tells Python that it has to wait for `get_burger
For `await` to work, it has to be inside a function that supports this asynchronicity. To do that, you just declare it with `async def`:
-```Python
+```Python hl_lines="1"
async def get_burgers(number: int):
# Do some asynchronous stuff to create the burgers
return burgers
@@ -291,7 +292,7 @@ async def get_burgers(number: int):
...instead of `def`:
-```Python
+```Python hl_lines="2"
# This is not asynchronous
def get_sequential_burgers(number: int):
# Do some sequential stuff to create the burgers
@@ -311,7 +312,7 @@ burgers = get_burgers(2)
So, if you are using a library that tells you that you can call it with `await`, you need to create the endpoint that uses it with `async def`, like in:
-```Python
+```Python hl_lines="2 3"
@app.get('/burgers')
async def read_burgers():
burgers = await get_burgers(2)
@@ -360,4 +361,4 @@ Let's see the same phrase from above:
That should make more sense now.
-All that is what powers FastAPI (through Starlette) and what makes it so powerful and have an impressive performance.
+All that is what powers FastAPI (through Starlette) and what makes it have such an impressive performance.
diff --git a/docs/features.md b/docs/features.md
index b35fa34b7..db76df5b2 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -202,3 +202,4 @@ With **FastAPI** you get all of **Pydantic**'s features (as FastAPI is based on
* You can have deeply **nested JSON** objects and have them all validated and annotated.
* **Extendible**:
* Pydantic allows custom data types to be defined or you can extend validation with methods on a model decorated with the validator decorator.
+* 100% test coverage.
\ No newline at end of file
diff --git a/docs/index.md b/docs/index.md
index 6102bb21e..40df4afbe 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -27,12 +27,17 @@ FastAPI is a modern, fast (high-performance), web framework for building APIs wi
The key features are:
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic).
+
+* **Fast to code**: Increase the speed to develop features by about 200% to 300% *.
+* **Less bugs**: Reduce about 40% of human (developer) induced errors. *
* **Intuitive**: Great editor support. Completion everywhere. Less time debugging.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
-* **Short**: Minimize code duplication. Multiple features from each parameter declaration.
+* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Less bugs.
* **Robust**: Get production-ready code. With automatic interactive documentation.
* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: OpenAPI and JSON Schema.
+* estimation based on tests on an internal development team, building production applications.
+
## Requirements
@@ -65,11 +70,27 @@ from fastapi import FastAPI
app = FastAPI()
+@app.get('/')
+def read_root():
+ return {'hello': 'world'}
+```
+
+Or if your code uses `async` / `await`, use `async def`:
+
+```Python hl_lines="6"
+from fastapi import FastAPI
+
+app = FastAPI()
+
@app.get('/')
async def read_root():
return {'hello': 'world'}
```
+!!! note
+ If you don't know, check the section about [`async` and `await` in the docs](async.md).
+
+
* Run the server with:
```bash
@@ -118,7 +139,7 @@ Now modify the file `main.py` to include:
* an optional query parameter `q`.
-```Python
+```Python hl_lines="2 7 8 9 10 19"
from fastapi import FastAPI
from pydantic import BaseModel
@@ -287,6 +308,9 @@ Used by Starlette:
* graphene
- Required for `GraphQLApp` support.
* ujson
- Required if you want to use `UJSONResponse`.
+Used by FastAPI / Starlette:
+
+* uvicorn
- for the server that loads and serves your application.
You can install all of these with `pip3 install fastapi[full]`.
diff --git a/mkdocs.yml b/mkdocs.yml
index 5339400e9..6aab97682 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -26,3 +26,5 @@ markdown_extensions:
guess_lang: false
- markdown_include.include:
base_path: docs
+ - admonition
+ - codehilite