Configuring site

Site configuration

quartodoc is configured by adding a quartodoc section to your _quarto.yml:

quartodoc:
  style: pkgdown
  dir: reference
  package: quartodoc
  sections:
    - title: Some functions
      desc: Functions to inspect docstrings.
      contents:
        - get_object
        - preview

Top-level options

The quartodoc section takes a style field, specifying which quartodoc.Builder to use (currently “pkgdown” or “single-page”; see Examples).

Name Type Description Default
package str The name of the package. required
sections 'list[Any]' A list of sections, with items to document. tuple()
version 'str | None' The package version. By default this attempts to look up the current package version (TODO). None
dir str Name of API directory. 'reference'
title str Title of the API index page. 'Function reference'
renderer 'dict | Renderer | str' The renderer used to convert docstrings (e.g. to markdown). 'markdown'
options 'dict | None' Default options to set for all pieces of content (e.g. include_attributes). None
out_index str The output path of the index file, used to list all API functions. None
sidebar 'str | dict[str, Any] | None' The output path for a sidebar yaml config (by default no config generated). Alternatively, can be a dictionary of Quarto sidebar options with an additional file key containing the output path for the sidebar YAML config file (by default _quartodoc-sidebar.yml if not specified). None
css 'str | None' The output path for the default css styles. None
rewrite_all_pages Whether to rewrite all rendered doc pages, or only those with changes. False
source_dir 'str | None' A directory where source files to be documented live. This is only necessary if you are not documenting a package, but collection of scripts. Use a “.” to refer to the current directory. None
dynamic bool | None Whether to dynamically load all python objects. By default, objects are loaded using static analysis. None
render_interlinks bool Whether to render interlinks syntax inside documented objects. Note that the interlinks filter is required to generate the links in quarto. False
parser Docstring parser to use. This correspond to different docstring styles, and can be one of “google”, “sphinx”, and “numpy”. Defaults to “numpy”. 'numpy'

Section options

The sections field defines which functions to document.

It commonly requires three pieces of configuration:

  • title: a title for the section
  • desc: a description for the section
  • contents: a list of functions to document

You can also replace title with subtitle to create a sub-section.