MCPcopy Create free account
hub / github.com/LabPy/lantz / create_modules_toc_file

Function create_modules_toc_file

docs/driversdoc.py:85–100  ·  view source on GitHub ↗

Create the module's index.

(modules, opts, name='modules')

Source from the content-addressed store, hash-verified

83
84
85def create_modules_toc_file(modules, opts, name='modules'):
86 """Create the module's index."""
87 text = format_heading(1, '%s' % opts.header)
88 text += '.. toctree::\n'
89 text += ' :maxdepth: %s\n\n' % opts.maxdepth
90
91 modules.sort()
92 prev_module = ''
93 for module in modules:
94 # look if the module is a subpackage and, if yes, ignore it
95 if module.startswith(prev_module + '.'):
96 continue
97 prev_module = module
98 text += ' %s\n' % module
99
100 write_file(name, text, opts)
101
102
103def shall_skip(module):

Callers 1

main2Function · 0.85

Calls 2

format_headingFunction · 0.85
write_fileFunction · 0.85

Tested by

no test coverage detected