#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.
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