GreatDocs

GreatDocs class for creating beautiful API documentation sites.

Usage

Source

GreatDocs(
    project_path=None,
    *,
    config_path=None,
    create=False,
)

This class provides methods to install assets and configure Quarto projects with the great-docs styling and functionality. It handles package discovery, API reference generation, Quarto configuration, and site building with a consistent, polished look.

Parameters

project_path: str | None = None
Path to the project root directory. If None (the default), the current working directory is used.

Attributes

project_root

Absolute path to the project root directory.

layout

Resolved package, documentation, build, and deployment paths.

build_dir
Absolute path to the selected Quarto project directory.

Examples

Create a documentation site for a Python package:

from great_docs import GreatDocs

gd = GreatDocs()

# One-time setup: generates great-docs.yml and discovers exports
gd.install()

# Build the documentation site
gd.build()

# Preview locally in a browser
gd.preview()

Build from a different directory:

gd = GreatDocs(project_path="/path/to/my-package")
gd.build()

Notes

The typical workflow is: install() once to scaffold configuration, then build() (and optionally preview()) as you iterate. The build() method re-discovers package exports by default, so new functions and classes are picked up automatically.