← GDG /

#190 gdtest_ref_module_expand

#190 gdtest_ref_module_expand OK CONFIG
Reference config referencing a submodule name for expansion.
Reference config that references a submodule name. The builder should expand the module into its individual members.
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

P6
P6Module expansionreference

Source Files

๐Ÿ“ gdtest_ref_module_expand/
๐Ÿ“„ __init__.py
"""Package with a submodule for reference expansion."""

from .utils import util_a, util_b, util_c

__all__ = ["main_func", "util_a", "util_b", "util_c"]


def main_func(data: str) -> str:
    """Process the main data input.

    Parameters
    ----------
    data : str
        The data string to process.

    Returns
    -------
    str
        The processed data.

    Examples
    --------
    >>> main_func("hello")
    'HELLO'
    """
    return data.upper()
๐Ÿ“„ utils.py
"""Utility functions for the package."""

__all__ = ["util_a", "util_b", "util_c"]


def util_a(value: int) -> int:
    """Double the input value.

    Parameters
    ----------
    value : int
        The value to double.

    Returns
    -------
    int
        The doubled value.

    Examples
    --------
    >>> util_a(5)
    10
    """
    return value * 2


def util_b(text: str) -> str:
    """Reverse the input text.

    Parameters
    ----------
    text : str
        The text to reverse.

    Returns
    -------
    str
        The reversed text.

    Examples
    --------
    >>> util_b("abc")
    'cba'
    """
    return text[::-1]


def util_c(items: list) -> int:
    """Count the number of items in a list.

    Parameters
    ----------
    items : list
        The list of items to count.

    Returns
    -------
    int
        The number of items.

    Examples
    --------
    >>> util_c([1, 2, 3])
    3
    """
    return len(items)
๐Ÿ“„ README.md
# gdtest-ref-module-expand

Test reference config with submodule expansion.
๐Ÿ“„ great-docs.yml
reference:
  - title: Core API
    desc: Top-level functions
    contents:
      - name: main_func
  - title: Utils API
    desc: Utility functions
    contents:
      - name: utils