From e4a6c1abfb3d5d921c61864a4b1a8c0fa82d4ad4 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 12 Dec 2025 21:14:25 +1100 Subject: [PATCH] Add information about building docs (#10998) --- docs/README.md | 24 ++++++++++++++++++++++++ tasks.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index d9d1b1e1da..41f0287f81 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,6 +15,18 @@ $ git clone https://github.com/inventree/inventree $ pip install --require-hashes -r docs/requirements.txt ``` +## Build Documentation + +Before serving the documentation, you will need to build the documentation files: + +``` +invoke build-docs +``` + +This is required to generate the required API schema files, and must be run before the documentation can be served. + +Note that this command is only required when building the documentation for the first time, or when changes have been made to the API schema. + ## Serve Locally To serve the pages locally, run the following command (from the top-level project directory): @@ -23,6 +35,18 @@ To serve the pages locally, run the following command (from the top-level projec $ mkdocs serve -f docs/mkdocs.yml -a localhost:8080 ``` +Alternatively, you can use the `invoke` command: + +``` +invoke dev.docs-server +``` + +To see all the available options: + +``` +invoke dev.docs-server --help +``` + ## Edit Documentation Files Once the server is running, it will monitor the documentation files for any changes, and update the served pages. diff --git a/tasks.py b/tasks.py index 9c2e0227d9..d0d1be5089 100644 --- a/tasks.py +++ b/tasks.py @@ -1904,7 +1904,7 @@ def doc_schema(c): @task( help={ 'address': 'Host and port to run the server on (default: localhost:8080)', - 'compile_schema': 'Compile the schema documentation first (default: False)', + 'compile_schema': 'Compile the API schema documentation first (default: False)', } ) def docs_server(c, address='localhost:8080', compile_schema=False):