← GDG /

#172 gdtest_sec_with_ref

#172 gdtest_sec_with_ref OK CONFIG
Custom Tutorials section combined with explicit reference config.
Custom section (Tutorials) combined with explicit reference config. Both custom nav sections and custom reference order should work.
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

N2 P1
N2Tutorials sectionsections
P1Explicit referencereference

Source Files

๐Ÿ“ gdtest_sec_with_ref/
๐Ÿ“„ __init__.py
"""Test package for custom section with reference config."""

from .core import analyze, format_output, process

__all__ = ["analyze", "format_output", "process"]
๐Ÿ“„ core.py
"""Core process/analyze/format_output functions."""


def process(data: list) -> list:
    """Process a list of data items.

    Parameters
    ----------
    data : list
        The raw data to process.

    Returns
    -------
    list
        The processed data.

    Examples
    --------
    >>> process([1, 2, 3])
    [2, 4, 6]
    """
    return [x * 2 for x in data]


def analyze(data: list) -> dict:
    """Analyze a list of data and return statistics.

    Parameters
    ----------
    data : list
        The data to analyze.

    Returns
    -------
    dict
        A dictionary with analysis results.

    Examples
    --------
    >>> analyze([10, 20, 30])
    {'mean': 20.0, 'count': 3}
    """
    if not data:
        return {"mean": 0.0, "count": 0}
    return {"mean": sum(data) / len(data), "count": len(data)}


def format_output(result: dict) -> str:
    """Format an analysis result as a readable string.

    Parameters
    ----------
    result : dict
        The result dictionary to format.

    Returns
    -------
    str
        A formatted string representation of the result.

    Examples
    --------
    >>> format_output({"mean": 2.0, "count": 3})
    'mean=2.0, count=3'
    """
    return ", ".join(f"{k}={v}" for k, v in result.items())
๐Ÿ“ tutorials/
๐Ÿ“„ step1.qmd
---
title: Step 1 - Getting Started
---

# Step 1 - Getting Started

The first step in the tutorial series.
๐Ÿ“„ step2.qmd
---
title: Step 2 - Going Further
---

# Step 2 - Going Further

The second step in the tutorial series.
๐Ÿ“„ README.md
# gdtest-sec-with-ref

Test custom section with explicit reference config.
๐Ÿ“„ great-docs.yml
sections:
  - title: Tutorials
    dir: tutorials
reference:
  - title: Core
    desc: Core API
    contents:
      - name: process
      - name: analyze
  - title: Helpers
    desc: Helper functions
    contents:
      - name: format_output