Skip to content

Commit

Permalink
docs: don't show code source (#2822)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Dec 28, 2024
1 parent edfb48f commit 8c15c0d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
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

0 comments on commit 8c15c0d

Please sign in to comment.