Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: don't show code source #2822

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ which provides SQLAlchemy core support against a range of different database dri
Here's a complete example, that includes table definitions, configuring a `database.Database`
instance, and a couple of endpoints that interact with the database.

**.env**

```ini
```ini title=".env"
DATABASE_URL=sqlite:///test.db
```

**app.py**

```python
```python title="app.py"
import contextlib

import databases
Expand Down
4 changes: 2 additions & 2 deletions docs/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ The `ExceptionMiddleware` implementation defaults to returning plain-text HTTP r
You should only raise `HTTPException` inside routing or endpoints.
Middleware classes should instead just return appropriate responses directly.

You can use an `HTTPException` on a WebSocket endpoint in case it's raised before `websocket.accept()`.
The connection is not upgraded to a WebSocket connection, and the proper HTTP response is returned.
You can use an `HTTPException` on a WebSocket endpoint. In case it's raised before `websocket.accept()`
the connection is not upgraded to a WebSocket connection, and the proper HTTP response is returned.

```python
from starlette.applications import Starlette
Expand Down
10 changes: 5 additions & 5 deletions docs/requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ You can also access the request body as a stream, using the `async for` syntax:
from starlette.requests import Request
from starlette.responses import Response


async def app(scope, receive, send):
assert scope['type'] == 'http'
request = Request(scope, receive)
Expand Down Expand Up @@ -155,11 +155,11 @@ async with request.form() as form:
```

!!! info
As settled in [RFC-7578: 4.2](https://www.ietf.org/rfc/rfc7578.txt), form-data content part that contains file
As settled in [RFC-7578: 4.2](https://www.ietf.org/rfc/rfc7578.txt), form-data content part that contains file
assumed to have `name` and `filename` fields in `Content-Disposition` header: `Content-Disposition: form-data;
name="user"; filename="somefile"`. Though `filename` field is optional according to RFC-7578, it helps
Starlette to differentiate which data should be treated as file. If `filename` field was supplied, `UploadFile`
object will be created to access underlying file, otherwise form-data part will be parsed and available as a raw
name="user"; filename="somefile"`. Though `filename` field is optional according to RFC-7578, it helps
Starlette to differentiate which data should be treated as file. If `filename` field was supplied, `UploadFile`
object will be created to access underlying file, otherwise form-data part will be parsed and available as a raw
string.

#### Application
Expand Down
1 change: 1 addition & 0 deletions docs/testclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
::: starlette.testclient.TestClient
options:
parameter_headings: false
show_bases: false
show_root_heading: true
heading_level: 3
filters:
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ plugins:
merge_init_into_class: true
parameter_headings: true
show_signature_annotations: true
show_source: false
signature_crossrefs: true
import:
- url: https://docs.python.org/3/objects.inv
Loading