mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-14 00:09:56 +00:00
Add information about building docs (#10998)
This commit is contained in:
@@ -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.
|
||||
|
||||
2
tasks.py
2
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):
|
||||
|
||||
Reference in New Issue
Block a user