Add referenced modules on generated toctrees

This commit is contained in:
Dan 2018-01-06 12:16:29 +01:00
parent 7d94ad340c
commit 26016eddd5
2 changed files with 5 additions and 0 deletions

View File

@ -85,18 +85,21 @@ def generate(source_path, base):
if k != base:
inner_path = base + "/" + k + "/index" + ".rst"
module = "pyrogram.api.{}.{}".format(base, k)
else:
for i in list(all_entities)[::-1]:
if i != base:
entities.insert(0, "{0}/index".format(i))
inner_path = base + "/index" + ".rst"
module = "pyrogram.api.{}".format(base)
with open(destination + "/" + inner_path, "w") as f:
f.write(
toctree.format(
title=k.title(),
title_markup="=" * len(k),
module=module,
entities="\n ".join(entities)
)
)

View File

@ -1,5 +1,7 @@
{title}
{title_markup}
.. module:: {module}
.. toctree::
{entities}