← GDG /

#307 gdtest_sec_xref_subdirs

#307 gdtest_sec_xref_subdirs OK CONFIG
Cross-refs into numeric-prefix section subdirs (#215)
A custom 'Examples' section whose pages live in numerically-prefixed subdirectories (01-topic-a/, 02-topic-b/) and cross-reference one another, plus an auto-discovery user-guide page that links into the section. Link rewriting strips numeric prefixes from every path component, so the section copy must strip prefixes from subdirectory names too โ€” otherwise files land at examples/02-topic-b/ while links point at examples/topic-b/, producing dead cross-references. Verifies the on-disk section paths and the rewritten links agree.
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

N12
N12Cross-refs into numeric-prefix subdirssections

Source Files

๐Ÿ“ examples/
๐Ÿ“ 01-topic-a/
๐Ÿ“„ intro.qmd
---
title: Intro
description: Introduction to topic A.
---

## Introduction

This is topic A. For a hands-on demo, see the
[widget demo](../02-topic-b/widget_demo.qmd) in topic B.
๐Ÿ“ 02-topic-b/
๐Ÿ“„ widget_demo.qmd
---
title: Widget Demo
description: A hands-on widget demonstration.
---

## Widget Demo

This is topic B. Return to the [intro](../01-topic-a/intro.qmd) for
background.
๐Ÿ“ gdtest_sec_xref_subdirs/
๐Ÿ“„ __init__.py
"""A test package for cross-references into prefixed section subdirs."""

__version__ = "0.1.0"
__all__ = ["render", "compose"]


def render(template: str) -> str:
    """
    Render a template string.

    Parameters
    ----------
    template
        The template to render.

    Returns
    -------
    str
        The rendered output.
    """
    return template


def compose(parts: list) -> str:
    """
    Compose parts into a single string.

    Parameters
    ----------
    parts
        The parts to compose.

    Returns
    -------
    str
        The composed result.
    """
    return "".join(parts)
๐Ÿ“ user_guide/
๐Ÿ“„ 10-concepts.qmd
---
title: Concepts
---

## Concepts

For a concrete example, see the
[widget demo](../examples/02-topic-b/widget_demo.qmd).
๐Ÿ“„ README.md
# gdtest-sec-xref-subdirs

A test package demonstrating cross-references into numerically
prefixed custom section subdirectories (`examples/02-topic-b/`).
๐Ÿ“„ great-docs.yml
display_name: Section Cross-Ref Subdirs Demo
sections:
  - title: Examples
    dir: examples
    index: true
user_guide: user_guide