← GDG /

#199 gdtest_toc_title

#199 gdtest_toc_title OK CONFIG
Tests site.toc-title: 'Contents' config.
Tests site.toc-title: 'Contents' (vs. default 'On this page'). The TOC heading should show 'Contents'.
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

Q6
Q6Custom TOC titletheme

Source Files

๐Ÿ“ gdtest_toc_title/
๐Ÿ“„ __init__.py
"""Package testing site toc-title config."""

__all__ = ["index", "lookup"]


def index(items: list) -> dict:
    """Build an index from a list of items.

    Parameters
    ----------
    items : list
        The items to index.

    Returns
    -------
    dict
        A dictionary mapping each item to its position.

    Examples
    --------
    >>> index(["a", "b", "c"])
    {'a': 0, 'b': 1, 'c': 2}
    """
    return {item: i for i, item in enumerate(items)}


def lookup(key: str) -> str:
    """Look up a value by key.

    Parameters
    ----------
    key : str
        The key to look up.

    Returns
    -------
    str
        The value associated with the key.

    Examples
    --------
    >>> lookup("name")
    'name'
    """
    return key
๐Ÿ“„ README.md
# gdtest-toc-title

Test site toc-title config.
๐Ÿ“„ great-docs.yml
site:
  toc-title: Contents