Skip to content

Commit 1eb4036

Browse files
authored
Change documentation layout (#2680)
1 parent b9db010 commit 1eb4036

File tree

11 files changed

+140
-250
lines changed

11 files changed

+140
-250
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<a href="https://www.starlette.io/"><img width="420px" src="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.png" alt='starlette'></a>
2+
<a href="https://www.starlette.io/"><img width="420px" src="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.svg" alt='starlette'></a>
33
</p>
44
<p align="center">
55
<em>✨ The little ASGI framework that shines. ✨</em>
@@ -11,7 +11,11 @@
1111
[![Package version](https://badge.fury.io/py/starlette.svg)](https://pypi.python.org/pypi/starlette)
1212
[![Supported Python Version](https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058)](https://pypi.org/project/starlette)
1313

14-
**Documentation**: [https://www.starlette.io/](https://www.starlette.io/)
14+
---
15+
16+
**Documentation**: <a href="https://www.starlette.io/" target="_blank">https://www.starlette.io</a>
17+
18+
**Source Code**: <a href="https://github.com/encode/starlette" target="_blank">https://github.com/encode/starlette</a>
1519

1620
---
1721

@@ -35,27 +39,21 @@ It is production-ready, and gives you the following:
3539
* Compatible with `asyncio` and `trio` backends.
3640
* Great overall performance [against independent benchmarks][techempower].
3741

38-
## Requirements
39-
40-
Python 3.8+
41-
4242
## Installation
4343

4444
```shell
45-
$ pip3 install starlette
45+
$ pip install starlette
4646
```
4747

4848
You'll also want to install an ASGI server, such as [uvicorn](https://www.uvicorn.org/), [daphne](https://github.com/django/daphne/), or [hypercorn](https://hypercorn.readthedocs.io/en/latest/).
4949

5050
```shell
51-
$ pip3 install uvicorn
51+
$ pip install uvicorn
5252
```
5353

5454
## Example
5555

56-
**example.py**:
57-
58-
```python
56+
```python title="example.py"
5957
from starlette.applications import Starlette
6058
from starlette.responses import JSONResponse
6159
from starlette.routing import Route
@@ -89,7 +87,7 @@ Starlette only requires `anyio`, and the following are optional:
8987
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
9088
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.
9189

92-
You can install all of these with `pip3 install starlette[full]`.
90+
You can install all of these with `pip install starlette[full]`.
9391

9492
## Framework or Toolkit
9593

docs/img/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/img/starlette.png

-256 KB
Binary file not shown.

docs/img/starlette.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/img/starlette_dark.svg

Lines changed: 1 addition & 0 deletions
Loading

docs/index.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
---
2+
hide: navigation
3+
---
4+
15
<p align="center">
2-
<img width="420px" src="/img/starlette.png" alt='starlette'>
6+
<img width="400px" src="/img/starlette.svg#only-light" alt="starlette"/>
7+
<img width="400px" src="/img/starlette_dark.svg#only-dark" alt="starlette"/>
38
</p>
49
<p align="center">
510
<em>✨ The little ASGI framework that shines. ✨</em>
@@ -11,10 +16,18 @@
1116
<a href="https://pypi.org/project/starlette/">
1217
<img src="https://badge.fury.io/py/starlette.svg" alt="Package version">
1318
</a>
19+
<a href="https://pypi.org/project/starlette" target="_blank">
20+
<img src="https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058" alt="Supported Python versions">
21+
</a>
1422
</p>
1523

1624
---
1725

26+
**Documentation**: <a href="https://www.starlette.io/" target="_blank">https://www.starlette.io</a>
27+
28+
**Source Code**: <a href="https://github.com/encode/starlette" target="_blank">https://github.com/encode/starlette</a>
29+
30+
---
1831

1932
# Introduction
2033

@@ -36,27 +49,21 @@ It is production-ready, and gives you the following:
3649
* Compatible with `asyncio` and `trio` backends.
3750
* Great overall performance [against independent benchmarks][techempower].
3851

39-
## Requirements
40-
41-
Python 3.8+
42-
4352
## Installation
4453

4554
```shell
46-
$ pip3 install starlette
55+
$ pip install starlette
4756
```
4857

4958
You'll also want to install an ASGI server, such as [uvicorn](https://www.uvicorn.org/), [daphne](https://github.com/django/daphne/), or [hypercorn](https://hypercorn.readthedocs.io/en/latest/).
5059

5160
```shell
52-
$ pip3 install uvicorn
61+
$ pip install uvicorn
5362
```
5463

5564
## Example
5665

57-
**example.py**:
58-
59-
```python
66+
```python title="example.py"
6067
from starlette.applications import Starlette
6168
from starlette.responses import JSONResponse
6269
from starlette.routing import Route
@@ -89,7 +96,7 @@ Starlette only requires `anyio`, and the following dependencies are optional:
8996
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
9097
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.
9198

92-
You can install all of these with `pip3 install starlette[full]`.
99+
You can install all of these with `pip install starlette[full]`.
93100

94101
## Framework or Toolkit
95102

docs/overrides/partials/nav.html

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/overrides/partials/toc-item.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!-- Copied from https://github.com/squidfunk/mkdocs-material/issues/4827#issuecomment-1869812019 -->
2+
<li class="md-nav__item"></li>
3+
<a href="{{ toc_item.url }}" class="md-nav__link">
4+
<span class="md-ellipsis">
5+
{{ toc_item.title }}
6+
</span>
7+
</a>
8+
9+
<!-- Table of contents list -->
10+
{% if toc_item.children %}
11+
<nav class="md-nav" aria-label="{{ toc_item.title | striptags }}">
12+
<ul class="md-nav__list">
13+
{% for toc_item in toc_item.children %}
14+
{% if not page.meta.toc_depth or toc_item.level <= page.meta.toc_depth %} {% include "partials/toc-item.html" %}
15+
{% endif %} {% endfor %} </ul>
16+
</nav>
17+
{% endif %}
18+
</li>

0 commit comments

Comments
 (0)