#198
gdtest_toc_depth
OK
CONFIG
Tests site.toc-depth: 3 config.
Tests site.toc-depth: 3 (deeper than default 2). The table of contents should show h3 headings as well as h2.
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
Q5
Q5TOC depth 3theme
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