Create the module's index.
(modules, opts, name='modules')
| 83 | |
| 84 | |
| 85 | def 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 | |
| 103 | def shall_skip(module): |
no test coverage detected