MCPcopy Create free account
hub / github.com/catchorg/Catch2 / removeToC

Function removeToC

tools/scripts/updateDocumentToC.py:60–73  ·  view source on GitHub ↗

Removes existing table of contents starting at index contentLineNdx.

(lines)

Source from the content-addressed store, hash-verified

58 return out
59
60def removeToC(lines):
61 """Removes existing table of contents starting at index contentLineNdx."""
62 if not lines[contentLineNdx ].startswith(contentTitle):
63 return lines[:]
64
65 result_top = lines[:contentLineNdx]
66
67 pos = contentLineNdx + 1
68 while lines[pos].startswith('['):
69 pos = pos + 1
70
71 result_bottom = lines[pos + 1:]
72
73 return result_top + result_bottom
74
75def dashifyHeadline(line):
76 """

Callers 1

markdownToclifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected