From 26016eddd58c0cb915588af71ac271336dee67ef Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 6 Jan 2018 12:16:29 +0100 Subject: [PATCH] Add referenced modules on generated toctrees --- compiler/docs/compiler.py | 3 +++ compiler/docs/template/toctree.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 99b556f4..af9d1315 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -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) ) ) diff --git a/compiler/docs/template/toctree.txt b/compiler/docs/template/toctree.txt index e2ba0696..717276c4 100644 --- a/compiler/docs/template/toctree.txt +++ b/compiler/docs/template/toctree.txt @@ -1,5 +1,7 @@ {title} {title_markup} +.. module:: {module} + .. toctree:: {entities} \ No newline at end of file