← GDG /

#282 gdtest_sec_dir_titles

#282 gdtest_sec_dir_titles OK CONFIG
Custom section with dir_titles overrides and numeric-prefix subdirectories.
Custom section with dir_titles overrides and numeric-prefix subdirectories (01-getting-started/, 02-results-and-reporting/, 03-advanced-topics/). Tests that numeric prefixes are stripped from sidebar section headings and that dir_titles mapping overrides the auto-generated title (e.g., 'Results/Reporting' instead of 'Results And Reporting').
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

N11
N11dir_titles + numeric prefix subdirssections

Source Files

๐Ÿ“ demos/
๐Ÿ“ 01-getting-started/
๐Ÿ“„ first-steps.qmd
---
title: First Steps
description: Your first steps with the package.
---

# First Steps

Start by importing the package and running a basic demo.
๐Ÿ“„ installation.qmd
---
title: Installation
description: How to install the package.
---

# Installation

Install with pip:

```bash
pip install gdtest-sec-dir-titles
```
๐Ÿ“ 02-results-and-reporting/
๐Ÿ“„ basic-report.qmd
---
title: Basic Report
description: Generate a basic results report.
---

# Basic Report

Use `show_results()` to display output.
๐Ÿ“„ custom-output.qmd
---
title: Custom Output
description: Customize the output format.
---

# Custom Output

Override the default formatting.
๐Ÿ“ 03-advanced-topics/
๐Ÿ“„ tips-and-tricks.qmd
---
title: Tips and Tricks
description: Advanced tips for power users.
---

# Tips and Tricks

Explore advanced patterns and optimizations.
๐Ÿ“ gdtest_sec_dir_titles/
๐Ÿ“„ __init__.py
"""Test package for dir_titles in section sidebars."""

from .core import run_demo, show_results

__all__ = ["run_demo", "show_results"]
๐Ÿ“„ core.py
"""Core demo functions."""


def run_demo(name: str) -> str:
    """Run a demo by name.

    Parameters
    ----------
    name : str
        The name of the demo to run.

    Returns
    -------
    str
        A summary of the demo run.

    Examples
    --------
    >>> run_demo("starter")
    'Running demo: starter'
    """
    return f"Running demo: {name}"


def show_results(data: list) -> str:
    """Show results from a demo run.

    Parameters
    ----------
    data : list
        A list of result values.

    Returns
    -------
    str
        Formatted results string.

    Examples
    --------
    >>> show_results([1, 2, 3])
    'Results: [1, 2, 3]'
    """
    return f"Results: {data}"
๐Ÿ“„ README.md
# gdtest-sec-dir-titles

Test dir_titles and numeric prefix stripping in section sidebars.
๐Ÿ“„ great-docs.yml
sections:
  - title: Demos
    dir: demos
    index: true
    dir_titles:
      getting-started: Getting Started
      results-and-reporting: Results/Reporting
      advanced-topics: Advanced Topics