Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,46 @@ Python bindings for C++ depthai-core library

Documentation is available over at [Luxonis DepthAI API](https://docs.luxonis.com/projects/api/en/latest/)

### Building documentation

- **Using [Docker](https://docs.docker.com/) (with [Docker Compose](https://docs.docker.com/compose/install/))**

```
cd docs
docker-compose build
docker-compose up
```

Then open [http://localhost:8000](http://localhost:8000).

This docker container will watch changes in the `docs/source` directory and rebuild the docs automatically

- **Linux**

First, please install the required [dependencies](#Dependencies)

Comment thread
VanDavv marked this conversation as resolved.
Then run the following commands to build the docs website

```
python3 -m pip install -U pip
python3 -m pip install -r docs/requirements.txt
cmake -S . -B build -D DEPTHAI_BUILD_DOCS=ON -D DEPTHAI_PYTHON_BUILD_DOCS=ON
cmake --build build --parallel --target sphinx
python3 -m http.server --bind 0.0.0.0 8000 --directory build/docs/sphinx
```

Then open [http://localhost:8000](http://localhost:8000).

This will build documentation based on current sources, so if some new changes will be made, run this command
in a new terminal window to update the website source

```
cmake --build build --parallel --target sphinx
```

Then refresh your page - it should load the updated website that was just built

Comment thread
VanDavv marked this conversation as resolved.

## Installation

Prebuilt wheels are available in [Luxonis repository](https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/)
Expand Down
9 changes: 9 additions & 0 deletions docs/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
docs:
build:
dockerfile: docs/docker/dev.dockerfile
context: ..
volumes:
- ./:/app/docs
ports:
- 8000:8000
13 changes: 13 additions & 0 deletions docs/docker/dev.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y libusb-1.0-0-dev clang python3-opencv python3-pip clang-11 doxygen cmake git
RUN python3 -m pip install -U pip numpy when-changed

ENV CC clang-10
ENV CXX clang++-10
WORKDIR /app
ADD docs/requirements.txt docs/requirements.txt
RUN python3 -m pip install -r docs/requirements.txt
ADD . .
CMD docs/docker/docker_run.sh
11 changes: 11 additions & 0 deletions docs/docker/docker_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -e

cmake -S . -B build -D DEPTHAI_BUILD_DOCS=ON -D DEPTHAI_PYTHON_BUILD_DOCS=ON

./docs/docker/update_docs.sh

when-changed -r docs/source -c "bash /app/docs/docker/update_docs.sh" &

python3 -m http.server --bind 0.0.0.0 8000 --directory build/docs/sphinx
8 changes: 8 additions & 0 deletions docs/docker/update_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e

cmake --build build --parallel --target sphinx

# fix missing index.css file
cp /app/docs/source/_static/css/* /app/build/docs/sphinx/_static/css
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Sphinx==3.4.3
sphinx-tabs==1.3.0
sphinx-rtd-theme==0.5.0
git+git://github.com/VanDavv/rtd-redirects.git@3e7333898acad533b37c9de426f1f2ef258d756b
git+https://github.com/VanDavv/rtd-redirects.git@3e7333898acad533b37c9de426f1f2ef258d756b
breathe==4.26.0
git+git://github.com/luxonis/pybind11_mkdoc.git@master
git+https://github.com/luxonis/pybind11_mkdoc.git@master
Sphinx-Substitution-Extensions==2020.9.30.0
sphinx-autopackagesummary==1.3
autodocsumm==0.2.2