From 9d87eec51af3b5c6febb884e8e7cfa038bd449e1 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 28 May 2026 21:09:17 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Add=20local=20documentation=20pr?= =?UTF-8?q?eview=20instructions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document the recommended workflow for serving the FastAPI documentation locally using scripts/docs.py. Also add instructions for previewing the multilingual documentation site and clarify the difference from directly running mkdocs serve. --- README.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/README.md b/README.md index eb0368762b..504524d58d 100644 --- a/README.md +++ b/README.md @@ -537,6 +537,44 @@ Additional optional FastAPI dependencies: * [`orjson`](https://github.com/ijl/orjson) - Required if you want to use `ORJSONResponse`. * [`ujson`](https://github.com/esnme/ultrajson) - Required if you want to use `UJSONResponse`. +## Develop the FastAPI Documentation Locally + +To work on the FastAPI documentation locally, install the documentation dependencies first: + +```console +$ uv sync --locked --no-dev --group docs +``` + +Then start the local documentation server with live reload: + +```console +$ uv run python ./scripts/docs.py live +``` + +This serves the English documentation locally and automatically reloads on changes. + +### Preview the Full Multilingual Documentation Site + +To build and preview the complete documentation site with all translations: + +```console +$ uv run python ./scripts/docs.py build-all +$ uv run python ./scripts/docs.py serve +``` + +This serves the generated `./site/` directory locally. + +### Alternative: Direct MkDocs Usage + +The English documentation can also be served directly from `docs/en/`: + +```console +$ cd docs/en +$ mkdocs serve +``` + +However, the `scripts/docs.py` commands are the preferred project-integrated workflow. + ## License This project is licensed under the terms of the MIT license.