mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Add referenced modules on generated toctrees
This commit is contained in:
parent
7d94ad340c
commit
26016eddd5
2 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
2
compiler/docs/template/toctree.txt
vendored
2
compiler/docs/template/toctree.txt
vendored
|
|
@ -1,5 +1,7 @@
|
|||
{title}
|
||||
{title_markup}
|
||||
|
||||
.. module:: {module}
|
||||
|
||||
.. toctree::
|
||||
{entities}
|
||||
Loading…
Reference in a new issue