mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-23 02:17:21 +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:
|
if k != base:
|
||||||
inner_path = base + "/" + k + "/index" + ".rst"
|
inner_path = base + "/" + k + "/index" + ".rst"
|
||||||
|
module = "pyrogram.api.{}.{}".format(base, k)
|
||||||
else:
|
else:
|
||||||
for i in list(all_entities)[::-1]:
|
for i in list(all_entities)[::-1]:
|
||||||
if i != base:
|
if i != base:
|
||||||
entities.insert(0, "{0}/index".format(i))
|
entities.insert(0, "{0}/index".format(i))
|
||||||
|
|
||||||
inner_path = base + "/index" + ".rst"
|
inner_path = base + "/index" + ".rst"
|
||||||
|
module = "pyrogram.api.{}".format(base)
|
||||||
|
|
||||||
with open(destination + "/" + inner_path, "w") as f:
|
with open(destination + "/" + inner_path, "w") as f:
|
||||||
f.write(
|
f.write(
|
||||||
toctree.format(
|
toctree.format(
|
||||||
title=k.title(),
|
title=k.title(),
|
||||||
title_markup="=" * len(k),
|
title_markup="=" * len(k),
|
||||||
|
module=module,
|
||||||
entities="\n ".join(entities)
|
entities="\n ".join(entities)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
2
compiler/docs/template/toctree.txt
vendored
2
compiler/docs/template/toctree.txt
vendored
@ -1,5 +1,7 @@
|
|||||||
{title}
|
{title}
|
||||||
{title_markup}
|
{title_markup}
|
||||||
|
|
||||||
|
.. module:: {module}
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
{entities}
|
{entities}
|
Loading…
x
Reference in New Issue
Block a user