MCPcopy Create free account
hub / github.com/base/base / section_order

Function section_order

etc/scripts/local/docs-index.py:193–203  ·  view source on GitHub ↗

Sort key placing sections in a stable, reader-friendly order.

(title: str)

Source from the content-addressed store, hash-verified

191
192
193def section_order(title: str) -> tuple[int, str]:
194 """Sort key placing sections in a stable, reader-friendly order."""
195 if title == SECTION_REPO:
196 return (0, title)
197 if title == SECTION_GUIDES:
198 return (1, title)
199 if title == SECTION_BINARIES:
200 return (2, title)
201 if title.startswith(SECTION_CRATES):
202 return (3, title)
203 return (4, title)
204
205
206def render_sections(entries: list[Entry]) -> str:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected