From 1754ee48789ef700137e6ab986cd13843f46e953 Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 4 Apr 2025 21:45:45 +0200 Subject: [PATCH 1/5] Corrections --- blacksheep/docs/behind-proxies.md | 12 ++++++------ blacksheep/docs/client.md | 16 +++++++--------- blacksheep/docs/css/extra.css | 16 ---------------- blacksheep/mkdocs.yml | 5 +---- mkdocs-plugins/docs/about.md | 2 +- mkdocs-plugins/mkdocs.yml | 5 +---- 6 files changed, 16 insertions(+), 40 deletions(-) diff --git a/blacksheep/docs/behind-proxies.md b/blacksheep/docs/behind-proxies.md index 1ca28e2..cfef0a8 100644 --- a/blacksheep/docs/behind-proxies.md +++ b/blacksheep/docs/behind-proxies.md @@ -108,7 +108,7 @@ sequenceDiagram Proxy-->>User: HTTP 404 Not Found ``` -/// details | The example of API Gateway +/// details | The example of API Gateways type: info API Gateways like [AWS API Gateway](https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/api-routing-path.html) @@ -132,13 +132,13 @@ implementing interactive sign-in. (applying URL rewrite). - The second approach involves configuring a prefix in the application router to globally change the prefix of all request handlers. The global prefix can - also be set using the environment variable `APP_ROUTE_PREFIX`. This method - assumes that modifying the path handled by the web server is desirable to - align it with the path handled by the HTTP proxy server, and it is ideal - when using URL rewrite is not easy. + be set when instantiating the `Router` or using the environment variable + `APP_ROUTE_PREFIX`. This method assumes that modifying the path handled by + the web server is desirable to align it with the path handled by the HTTP + proxy server, and it is ideal when applying URL rewrite is not easy. For both options, `BlackSheep` handles the information provided by `root_path` -or the application router prefix in some specific ways. +and the application router prefix in some specific ways. For example, the `get_absolute_url_to_path` defined in `blacksheep.messages` will handle the information and return an absolute URL to the server according to both scenarios. diff --git a/blacksheep/docs/client.md b/blacksheep/docs/client.md index 39f5eba..20b61b0 100644 --- a/blacksheep/docs/client.md +++ b/blacksheep/docs/client.md @@ -4,16 +4,17 @@ BlackSheep includes an implementation of HTTP Client for HTTP 1.1. ## Client features -- HTTP connection pooling -- User-friendly handling of SSL contexts (safe by default) -- Support for client side middlewares +- HTTP connection pooling. +- User-friendly handling of SSL contexts (safe by default). +- Support for client side middlewares. - Automatic handling of redirects (can be disabled, validates circular redirects and maximum number of redirects - redirects to URN are simply - returned to code using the client) + returned to code using the client). - Automatic handling of cookies (can be disabled, `Set-Cookie` and `Cookie` - headers) + headers). **Example:** + ```python import asyncio from blacksheep.client import ClientSession @@ -30,7 +31,6 @@ async def client_example(loop): loop = asyncio.get_event_loop() loop.run_until_complete(client_example(loop)) - ``` ## HTTP Connection pooling @@ -59,7 +59,6 @@ design pattern, and this is supported in BlackSheep. ```python async def client_example_middleware(request, next_handler): - # do something before the request is sent response = await next_handler(request) @@ -86,7 +85,6 @@ if it was created for the client. It is recommended to instantiate a single instance of HTTP client and register it as a service of the application, using the `@app.lifespan` method: -```python ```python from blacksheep import Application from blacksheep.client.session import ClientSession @@ -111,5 +109,5 @@ async def home(http_client: ClientSession): ``` When following this approach, the HTTP client can be automatically injected -into request handlers, and services that need it, and is automatically disposed +into request handlers and services that need it, and is automatically disposed of when the application is stopped. diff --git a/blacksheep/docs/css/extra.css b/blacksheep/docs/css/extra.css index 6a684fd..cf0cec7 100644 --- a/blacksheep/docs/css/extra.css +++ b/blacksheep/docs/css/extra.css @@ -2,22 +2,6 @@ html { overflow-y: scroll; } -/* For large screens, make better use of the horizontal space */ -@media screen and (min-width: 2000px) { - .md-grid { - max-width: 98%; - } - - .md-sidebar { - width: auto; - min-width: 15%; - } - - body.fullscreen #fullscreen-form label { - display: none !important; - } -} - @media screen and (min-width: 1000px) { html.fullscreen { .md-grid { diff --git a/blacksheep/mkdocs.yml b/blacksheep/mkdocs.yml index 308a855..7f728a8 100644 --- a/blacksheep/mkdocs.yml +++ b/blacksheep/mkdocs.yml @@ -90,10 +90,7 @@ extra_javascript: plugins: - search - - neoteroi.contribs: - contributors: - - email: roberto.prevato@gmail.com - image: https://avatars.githubusercontent.com/u/2576032?s=400&u=d8d880e8ed05bb170877dd3d561d8301c4beeeed&v=4 + - neoteroi.contribs markdown_extensions: - admonition diff --git a/mkdocs-plugins/docs/about.md b/mkdocs-plugins/docs/about.md index 091ea9a..b489454 100644 --- a/mkdocs-plugins/docs/about.md +++ b/mkdocs-plugins/docs/about.md @@ -5,4 +5,4 @@ ## The project's home The project source code is in [GitHub](https://github.com/Neoteroi/mkdocs-plugins). -The documentation source code is in [GitHub](https://github.com/Neoteroi/mkdocs-plugins-docs). +The documentation source code is here in [GitHub](https://github.com/Neoteroi/neoteroi.github.io). diff --git a/mkdocs-plugins/mkdocs.yml b/mkdocs-plugins/mkdocs.yml index daf2d7c..7c4efdb 100644 --- a/mkdocs-plugins/mkdocs.yml +++ b/mkdocs-plugins/mkdocs.yml @@ -48,10 +48,7 @@ extra_css: plugins: - search - - neoteroi.contribs: - contributors: - - email: roberto.prevato@gmail.com - image: https://avatars.githubusercontent.com/u/2576032?s=400&u=d8d880e8ed05bb170877dd3d561d8301c4beeeed&v=4 + - neoteroi.contribs markdown_extensions: - admonition From 5ee2e21d9f96baa866731e6b3a71010e248887fb Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 4 Apr 2025 21:52:46 +0200 Subject: [PATCH 2/5] Update README.md --- mkdocs-plugins/README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mkdocs-plugins/README.md b/mkdocs-plugins/README.md index 4d110b2..78f9dbc 100644 --- a/mkdocs-plugins/README.md +++ b/mkdocs-plugins/README.md @@ -1,3 +1,8 @@ # MkDocs Plugins docs 📜 [www.neoteroi.dev](https://www.neoteroi.dev/mkdocs-plugins/). + +## Additional contributors + +This section lists contributors from the [previous repository](https://github.com/Neoteroi/mkdocs-plugins-docs), +before the code was transferred here. From b0d58c4b38765eda43c0f8390028db5dc235bdf7 Mon Sep 17 00:00:00 2001 From: Ramzi Sabra Date: Fri, 4 Apr 2025 21:59:14 +0200 Subject: [PATCH 3/5] Credit @yasamoka --- mkdocs-plugins/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mkdocs-plugins/README.md b/mkdocs-plugins/README.md index 78f9dbc..9365ff6 100644 --- a/mkdocs-plugins/README.md +++ b/mkdocs-plugins/README.md @@ -6,3 +6,6 @@ This section lists contributors from the [previous repository](https://github.com/Neoteroi/mkdocs-plugins-docs), before the code was transferred here. + +- [@SerTetora](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=SerTetora) +- [@yasamoka](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=yasamoka) From 36f9cb6b035533517a356a7600cb87daf5b88c13 Mon Sep 17 00:00:00 2001 From: Roberto Prevato Date: Fri, 4 Apr 2025 22:00:58 +0200 Subject: [PATCH 4/5] Update README.md --- mkdocs-plugins/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/mkdocs-plugins/README.md b/mkdocs-plugins/README.md index 9365ff6..4d38fd5 100644 --- a/mkdocs-plugins/README.md +++ b/mkdocs-plugins/README.md @@ -7,5 +7,4 @@ This section lists contributors from the [previous repository](https://github.com/Neoteroi/mkdocs-plugins-docs), before the code was transferred here. -- [@SerTetora](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=SerTetora) - [@yasamoka](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=yasamoka) From a4c9db56b706cdabfddbb52c5117b9bca2332112 Mon Sep 17 00:00:00 2001 From: Serhii Tetora <95703687+SerTetora@users.noreply.github.com> Date: Fri, 4 Apr 2025 22:01:32 +0200 Subject: [PATCH 5/5] Credit @SerTetora --- mkdocs-plugins/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mkdocs-plugins/README.md b/mkdocs-plugins/README.md index 4d38fd5..9365ff6 100644 --- a/mkdocs-plugins/README.md +++ b/mkdocs-plugins/README.md @@ -7,4 +7,5 @@ This section lists contributors from the [previous repository](https://github.com/Neoteroi/mkdocs-plugins-docs), before the code was transferred here. +- [@SerTetora](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=SerTetora) - [@yasamoka](https://github.com/Neoteroi/mkdocs-plugins-docs/commits?author=yasamoka)