Documentation Generation Instructions

Note: Before proceeding, please build Drake from source. This is necessary because otherwise the various build targets mentioned below will not exist.

This section contains instructions on how to generate Drake’s documentation. This includes both API documentation (C++ and MATLAB), which uses Doxygen, and Drake’s website, which uses Sphinx.

When using Bazel

At the moment, only the website (Sphinx) documentation is supported via the Bazel build:

$ bazel run //drake/doc:serve_sphinx

This will rebuild the website content and serve it to your web browser for preview using

To merely compile the website into bazel-genfiles/drake/doc/ without launching a preview:

$ bazel build //drake/

When using CMake

Drake’s documentation is built using the documentation build target. After building Drake like normal, execute:

$ cd drake-distro/build/drake
$ [make|ninja] documentation

To view the generated documentation, open the following files using a web browser:

  • Drake website: drake-distro/build/drake/doc/sphinx/index.html
  • Doxygen C++ website: drake-distro/build/drake/doc/doxygen_cxx/html/index.html
  • Doxygen Matlab website: drake-distro/build/drake/doc/doxygen_matlab/html/index.html

If you’re using ninja, there are two additional build targets that allow you to build just the Sphinx website or C++ Doxygen website:

$ cd drake-distro/build/drake
$ ninja doc/doxygen_cxx_output
$ ninja doc/sphinx_output