Skip to content

Commit

Permalink
Change documentation layout (#2680)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Sep 1, 2024
1 parent b9db010 commit 1eb4036
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 250 deletions.
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<a href="https://www.starlette.io/"><img width="420px" src="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.png" alt='starlette'></a>
<a href="https://www.starlette.io/"><img width="420px" src="https://raw.githubusercontent.com/encode/starlette/master/docs/img/starlette.svg" alt='starlette'></a>
</p>
<p align="center">
<em>✨ The little ASGI framework that shines. ✨</em>
Expand All @@ -11,7 +11,11 @@
[![Package version](https://badge.fury.io/py/starlette.svg)](https://pypi.python.org/pypi/starlette)
[![Supported Python Version](https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058)](https://pypi.org/project/starlette)

**Documentation**: [https://www.starlette.io/](https://www.starlette.io/)
---

**Documentation**: <a href="https://www.starlette.io/" target="_blank">https://www.starlette.io</a>

**Source Code**: <a href="https://github.com/encode/starlette" target="_blank">https://github.com/encode/starlette</a>

---

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

## Requirements

Python 3.8+

## Installation

```shell
$ pip3 install starlette
$ pip install starlette
```

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/).

```shell
$ pip3 install uvicorn
$ pip install uvicorn
```

## Example

**example.py**:

```python
```python title="example.py"
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
Expand Down Expand Up @@ -89,7 +87,7 @@ Starlette only requires `anyio`, and the following are optional:
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.

You can install all of these with `pip3 install starlette[full]`.
You can install all of these with `pip install starlette[full]`.

## Framework or Toolkit

Expand Down
1 change: 1 addition & 0 deletions docs/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/starlette.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/img/starlette.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/img/starlette_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 18 additions & 11 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
hide: navigation
---

<p align="center">
<img width="420px" src="/img/starlette.png" alt='starlette'>
<img width="400px" src="/img/starlette.svg#only-light" alt="starlette"/>
<img width="400px" src="/img/starlette_dark.svg#only-dark" alt="starlette"/>
</p>
<p align="center">
<em>✨ The little ASGI framework that shines. ✨</em>
Expand All @@ -11,10 +16,18 @@
<a href="https://pypi.org/project/starlette/">
<img src="https://badge.fury.io/py/starlette.svg" alt="Package version">
</a>
<a href="https://pypi.org/project/starlette" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/starlette.svg?color=%2334D058" alt="Supported Python versions">
</a>
</p>

---

**Documentation**: <a href="https://www.starlette.io/" target="_blank">https://www.starlette.io</a>

**Source Code**: <a href="https://github.com/encode/starlette" target="_blank">https://github.com/encode/starlette</a>

---

# Introduction

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

## Requirements

Python 3.8+

## Installation

```shell
$ pip3 install starlette
$ pip install starlette
```

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/).

```shell
$ pip3 install uvicorn
$ pip install uvicorn
```

## Example

**example.py**:

```python
```python title="example.py"
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
Expand Down Expand Up @@ -89,7 +96,7 @@ Starlette only requires `anyio`, and the following dependencies are optional:
* [`itsdangerous`][itsdangerous] - Required for `SessionMiddleware` support.
* [`pyyaml`][pyyaml] - Required for `SchemaGenerator` support.

You can install all of these with `pip3 install starlette[full]`.
You can install all of these with `pip install starlette[full]`.

## Framework or Toolkit

Expand Down
53 changes: 0 additions & 53 deletions docs/overrides/partials/nav.html

This file was deleted.

18 changes: 18 additions & 0 deletions docs/overrides/partials/toc-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Copied from https://github.com/squidfunk/mkdocs-material/issues/4827#issuecomment-1869812019 -->
<li class="md-nav__item"></li>
<a href="{{ toc_item.url }}" class="md-nav__link">
<span class="md-ellipsis">
{{ toc_item.title }}
</span>
</a>

<!-- Table of contents list -->
{% if toc_item.children %}
<nav class="md-nav" aria-label="{{ toc_item.title | striptags }}">
<ul class="md-nav__list">
{% for toc_item in toc_item.children %}
{% if not page.meta.toc_depth or toc_item.level <= page.meta.toc_depth %} {% include "partials/toc-item.html" %}
{% endif %} {% endfor %} </ul>
</nav>
{% endif %}
</li>
Loading

0 comments on commit 1eb4036

Please sign in to comment.