MCPcopy
hub / github.com/rossant/awesome-math / gen_toc

Function gen_toc

build_toc.py:52–62  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

50
51
52def gen_toc(filename):
53 md = _read_md(filename)
54 i = md.index(_START_TOC) + len(_START_TOC) + 2
55 j = md.index(_END_TOC)
56 with open(filename, 'w') as f:
57 f.write(md[:i])
58 for item in _gen_items(md):
59 if 'Awesome Math' in item:
60 continue
61 f.write(item + '\n')
62 f.write('\n' + md[j:])
63
64
65if __name__ == '__main__':

Callers 1

build_toc.pyFile · 0.85

Calls 2

_read_mdFunction · 0.85
_gen_itemsFunction · 0.85

Tested by

no test coverage detected