Links
AI / Agents
gdtest-sec-xref-subdirs
A test package demonstrating cross-references into numerically prefixed custom section subdirectories (examples/02-topic-b/).
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.
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