MCPcopy
hub / github.com/mkdocs/mkdocs / TableOfContents

Class TableOfContents

mkdocs/structure/toc.py:60–73  ·  view source on GitHub ↗

Represents the table of contents for a given page.

Source from the content-addressed store, hash-verified

58
59
60class TableOfContents(Iterable[AnchorLink]):
61 """Represents the table of contents for a given page."""
62
63 def __init__(self, items: list[AnchorLink]) -> None:
64 self.items = items
65
66 def __iter__(self) -> Iterator[AnchorLink]:
67 return iter(self.items)
68
69 def __len__(self) -> int:
70 return len(self.items)
71
72 def __str__(self) -> str:
73 return ''.join(str(item) for item in self)
74
75
76def _parse_toc_token(token: _TocToken) -> AnchorLink:

Callers 1

get_tocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…