← GDG /

#193 gdtest_ref_title

#193 gdtest_ref_title OK CONFIG
Reference config with custom title and description.
Reference config with title: 'API Docs' and a description paragraph instead of default. The reference page heading should use this custom title, followed by the description text.
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

P8
P8Reference titlereference

Source Files

๐Ÿ“ gdtest_ref_title/
๐Ÿ“„ __init__.py
"""Package testing reference config with custom title."""

__all__ = ["query", "insert", "delete"]


def query(sql: str) -> list:
    """Execute a SQL query and return the results.

    Parameters
    ----------
    sql : str
        The SQL query string to execute.

    Returns
    -------
    list
        A list of result rows.

    Examples
    --------
    >>> query("SELECT * FROM users")
    [{'id': 1, 'name': 'Alice'}]
    """
    return [{"id": 1, "name": "Alice"}]


def insert(table: str, data: dict) -> int:
    """Insert a row into a table and return the new row ID.

    Parameters
    ----------
    table : str
        The name of the table to insert into.
    data : dict
        A dictionary of column-value pairs.

    Returns
    -------
    int
        The ID of the newly inserted row.

    Examples
    --------
    >>> insert("users", {"name": "Bob"})
    2
    """
    return 2


def delete(table: str, id: int) -> bool:
    """Delete a row from a table by its ID.

    Parameters
    ----------
    table : str
        The name of the table to delete from.
    id : int
        The ID of the row to delete.

    Returns
    -------
    bool
        True if the row was deleted successfully.

    Examples
    --------
    >>> delete("users", 1)
    True
    """
    return True
๐Ÿ“„ README.md
# gdtest-ref-title

Test reference config with custom title.
๐Ÿ“„ great-docs.yml
reference:
  title: API Docs
  desc: Welcome to the API documentation. This reference covers all public functions available in the package.