]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
docs: don't show code source (#2822)
authorMarcelo Trylesinski <marcelotryle@gmail.com>
Sat, 28 Dec 2024 08:45:17 +0000 (09:45 +0100)
committerGitHub <noreply@github.com>
Sat, 28 Dec 2024 08:45:17 +0000 (09:45 +0100)
docs/database.md
docs/exceptions.md
docs/requests.md
docs/testclient.md
mkdocs.yml

index 8e599dbcdba941871f909cb853d143667754b93a..f8b2f70302b125f0f97a7b191a7fb436a4c506d6 100644 (file)
@@ -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
index 2a351e7711ee6ef60f2b469fba47ee2d92a56ed8..75a1c8e2287a6506c0ac2312d52eedf9aa623d16 100644 (file)
@@ -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
index 368755f137f54a89815da65fcd2275bd2bb34577..d63055532280dc81e407f5e70f7f134467f2603a 100644 (file)
@@ -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)
@@ -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
index 258186b0456825d49ce9195a4273dfb6c5494702..ab05c429053e4dc5442de713d2d35eea97511ea1 100644 (file)
@@ -3,6 +3,7 @@
     ::: starlette.testclient.TestClient
         options:
             parameter_headings: false
+            show_bases: false
             show_root_heading: true
             heading_level: 3
             filters:
index 55bf1c22462db3f4d4978db6914d9542e823b384..b1f32422aa1d2afadf40aeb0ed2d02dd4d9e8ea2 100644 (file)
@@ -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