Links
AI / Agents
gdtest-toc-depth
Test site toc-depth config.
Tests site.toc-depth: 3 (deeper than default 2). The table of contents should show h3 headings as well as h2.
Source files
gdtest_toc_depth/
__init__.py
"""Package testing site toc-depth config."""
__all__ = ["outline", "expand"]
def outline(doc: str) -> list:
"""Generate an outline for the given document.
Parameters
----------
doc : str
The document content to outline.
Returns
-------
list
A list of section headings.
Examples
--------
>>> outline("Chapter 1")
['Chapter 1']
"""
return [doc]
def expand(section: str) -> dict:
"""Expand a section into its subsections.
Parameters
----------
section : str
The section name to expand.
Returns
-------
dict
A dictionary with the section and its children.
Examples
--------
>>> expand("intro")
{'section': 'intro', 'children': []}
"""
return {"section": section, "children": []}README.md
# gdtest-toc-depth Test site toc-depth config.
great-docs.yml
site: toc-depth: 3