(modules)
| 169 | |
| 170 | |
| 171 | def replace_toc(modules): |
| 172 | toctree = [module.replace(".", "/") for module in modules] |
| 173 | with open(DOCS_DIR / "index.rst", "r") as index_file: |
| 174 | index_contents = index_file.read() |
| 175 | toc = TOC_TEMPLATE.format( |
| 176 | toctree="\n ".join(toctree) |
| 177 | ) |
| 178 | index_contents = re.sub(TOC_REGEX, toc, index_contents) |
| 179 | with open(DOCS_DIR / "index.rst", "w") as index_file: |
| 180 | index_file.write(index_contents) |
| 181 | |
| 182 | |
| 183 | def main(): |