File: builddocs.rst

package info (click to toggle)
open3d 0.19.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,496 kB
  • sloc: cpp: 206,543; python: 27,254; ansic: 8,356; javascript: 1,883; sh: 1,527; makefile: 259; xml: 69
file content (118 lines) | stat: -rw-r--r-- 3,252 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.. _builddocs:

Build documentation
======================

The main documentation and Python documentation is written in
`reStructuredText <http://www.sphinx-doc.org/en/stable/rest.html>`_ and
generated by `sphinx <http://www.sphinx-doc.org/>`_. The C++ API documentation
is generated by `Doxygen <http://www.doxygen.nl/>`_.

Documentation can be built on Ubuntu or macOS. Building documentation on Windows
may also be possible but is not officially tested.

If you're building documentation on a computer without a display, please use
:ref:`headless_rendering`, otherwise the Jupyter tutorials will fail to execute.


Install system dependencies
---------------------------

**Ubuntu**

.. code-block:: bash

    sudo apt-get -y install doxygen texlive texlive-latex-extra ghostscript pandoc

**macOS**

First, install a TeX distribution such as `MacTeX <http://www.tug.org/mactex/>`_.

.. code-block:: bash

    brew install ghostscript pandoc doxygen


Building C++ documentation
--------------------------

If you only want to build C++ API documentation, clone the Open3D repo and run
doxygen.

.. code-block:: bash

   git clone https://github.com/isl-org/open3d
   cd open3d/docs
   doxygen Doxyfile.in

Start browsing the generated C++ API documentation from the file
``docs/doxygen/html/index.html``. Read on if you want to build the full
documentation (including Python API and tutorials).


Install or Build Open3D
-----------------------

.. code-block:: bash

    pip install open3d

To instead build Open3D from source, see :ref:`compilation`.


Install Python dependencies
---------------------------

.. code-block:: bash

    pip install -r docs/requirements.txt

Build docs
----------


.. code-block:: bash

    cd docs

    # Run `python make_docs.py --help` to usage of the flags.
    python make_docs.py --help

    # Example: build .rst and C++ docs only, skip notebooks.
    python make_docs.py --execute_notebooks=never --sphinx --doxygen

    # Example: build .rst and C++ docs only, skip notebooks, with parallel build.
    python make_docs.py --execute_notebooks=never --sphinx --doxygen --parallel

    # Example: build .rst and c++ docs, execute notebooks when it has not been executed.
    python make_docs.py --execute_notebooks=auto --sphinx --doxygen

The docs html will be saved in ``docs/_out`` folder.

Preview
-------

Open ``docs/_out/html/index.html`` in a web browser to preview the docs.

.. code-block:: bash

    google-chrome docs/_out/html/index.html


Create Python stubs (type hints) for type checking and autocomplete
-------------------------------------------------------------------

You can get type checking and auto-complete features in editors and IDES (e.g.
 VS Code, PyCharm, etc.) using type hints produced from Open3D. These can be
 created with the pybind11-stubgen tool and placed alongside the Open3D files:

.. code-block:: bash

    # Install open3d and pybind11-stubgen
    pip install pybind11-stubgen open3d
    # Print location of install open3d library
    pip show open3d
    # This outputs a line like: 
    # Location: path/to/venv/site-packages
    # Create stubs and place them next to Open3D files
    pybind11-stubgen -o <path/to/venv/site-packages/> --root-suffix "" open3d