mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-22 20:23:27 +00:00
Improvements to the documentation instructions (#11044)
This commit is contained in:
@@ -38,19 +38,13 @@ $ cd src
|
|||||||
$ pip install --require-hashes -r docs/requirements.txt
|
$ pip install --require-hashes -r docs/requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build Documentation
|
## Schema generation
|
||||||
|
|
||||||
Before serving the documentation, you will need to build the API schema files from the source code, so they can be included in the documentation:
|
Building the documentation requires extracting the API schema from the source code.
|
||||||
|
|
||||||
```
|
|
||||||
invoke build-docs
|
|
||||||
```
|
|
||||||
|
|
||||||
!!! tip
|
!!! tip
|
||||||
This command is only required when building the documentation for the first time, or when changes have been made to the API schema.
|
This command is only required when building the documentation for the first time, or when changes have been made to the API schema.
|
||||||
|
|
||||||
## Serve Local files
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ invoke build-docs
|
$ invoke build-docs
|
||||||
```
|
```
|
||||||
@@ -71,41 +65,31 @@ Schema export completed: /home/inventree/src/docs/generated/schema.yml
|
|||||||
Documentation build complete, but mkdocs not requested
|
Documentation build complete, but mkdocs not requested
|
||||||
```
|
```
|
||||||
|
|
||||||
If that worked, you can now generate the HTML format documentation pages:
|
## Viewing the documentation
|
||||||
|
|
||||||
|
Generate the HTML files from the markdown source files, and start the MkDocs webpage server:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ mkdocs build -f docs/mkdocs.yml
|
$ mkdocs serve -f docs/mkdocs.yml
|
||||||
```
|
|
||||||
|
|
||||||
## Viewing the generated output
|
|
||||||
|
|
||||||
To view the documentation locally, run the following command to start the MkDocs webpage server:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ 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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can then point your web browser at http://localhost:8080/
|
You can then point your web browser at http://localhost:8080/
|
||||||
|
|
||||||
|
Alternatively, you can use the `invoke` command:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ invoke dev.docs-server
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need to, use the `-a` option after `mkdocs` or `invoke` to set the address and port. Run `invoke dev.docs-server --help` for details.
|
||||||
|
|
||||||
## Editing the Documentation Files
|
## Editing the Documentation Files
|
||||||
|
|
||||||
Once the server is running, it will monitor the documentation files for any changes, and regenerate the HTML pages.
|
Once the server is running, it will monitor the documentation files for changes, and regenerate the HTML pages as required. Refresh your web browser to see the changes.
|
||||||
|
|
||||||
### Admonitions
|
### Admonitions
|
||||||
|
|
||||||
"Admonition" blocks can be added as follow:
|
"Admonition" blocks can be added to the documentation source as follows:
|
||||||
```
|
```
|
||||||
!!! info "This is the admonition block title"
|
!!! info "This is the admonition block title"
|
||||||
This is the admonition block content
|
This is the admonition block content
|
||||||
|
|||||||
Reference in New Issue
Block a user