Skip to content

How to build the documentation locally

Alberto F. Martin edited this page Feb 11, 2021 · 6 revisions

We use Documenter.jl julia package as documentation generation system..

Assuming that your local project MyPackage clone is hosted in $MYPACKAGE_DIR directory, the documentation source code is located in $MYPACKAGE_DIR/docs.

The documentation directory ($MYPACKAGE_DIR/docs) is itself a julia project. It contains its own Project.toml file, a make.jl julia file and some more content under $MYPACKAGE_DIR/docs/src directory.

Assuming also that you already have a Julia version available in your local machine, to generate the documentation locally, you need to start Julia REPL from the package directory::

$ cd $MYPACKAGE_DIR
$ julia --project=docs/ 

Inside the Julia REPL you need to load the required dependencies and run the documentation generation script:

pkg> develop .                   # (1)
pkg> instantiate                 # (2)
julia> include("docs/make.jl")   # (3)

These commands generate the documentation in $MYPACKAGE_DIR/docs/build directory. In particular

  1. Make MyPackage project available for development.
  2. Resolve and install all required dependencies.
  3. Generate the documentation.

After that process, you should be able to dive into your locally generated documentation.

Please, open $MYPACKAGE_DIR/docs/build/index.html, using your preferred browser, to start exploring the docs.