Configuration

The following configuration values can be set in your Sphinx configuration file:

extensions = [
    "sphinxcontrib_enum",
]

# offer csv and json downloads for every table (off by default)
enum_table_download = True

# or only offer json downloads
enum_table_download = ["json"]

# format cells with a custom function
enum_table_formatter = "mypackage.docs.format_cell"
enum_table_download
Type:
bool | list[str] | str | None
Default:
False

The download formats to offer beneath every table. Downloads are off by default.

  • False, None or an empty list - no download buttons.

  • True - offer every supported format (csv and json).

  • A list of formats, e.g. ["json"] or ["csv", "json"], or the same as a comma separated string ("csv, json"). Buttons are rendered in the order given.

Unsupported formats are a configuration error. Can be overridden per table with enum-table:download, so individual tables can opt in or out.

enum_table_formatter
Type:
str | Callable | None
Default:
None

A function, or the import path of a function, used to format every table cell. See Formatter. Import paths are preferred because Sphinx cannot cache function configuration values between builds. Can be overridden per table with enum-table:formatter.