mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-23 23:34:28 +00:00
Add referenced modules on generated toctrees
This commit is contained in:
parent
7d94ad340c
commit
26016eddd5
@ -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 New Issue
Block a user