Getting started

Create Hugo Project

Just like any other Hugo site, you first need to create a new Hugo project. Follow Hugo’s documentation for more information.

Configuration

The gist of how pyhugodocs works: you list the objects to be documented in a “reference directory” (usually called _api-reference). This folder is set to be ignored by Hugo (you have to add that to your config.toml!) pyhugodoc then reads these objects, gets their docstrings, and generates a api-reference folder automatically. This is the folder that Hugo will render.

Check out pyhugodoc’s GitHub repository for a sample!

Once you have installed pyhugodoc, you need to create a config file to tell it where to look for content. The config file should be called pyhugodoc.yaml and should be in the root of your repository.

Sample:

site_dir: docs  # the name of the folder in which the Hugo site is
reference_dir: content/_api-reference  # path to reference dir, relative to site_dir
docstring_style: google  # the docstring style used; can be google or numpy