From b762a701f2c85f0c5f7223973b9cdf3aab942e01 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 5 Jan 2018 03:15:48 +0100 Subject: [PATCH] Fix docs source generation when manually executing the script --- compiler/docs/compiler.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index c335ede5..9be0f24b 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -31,12 +31,6 @@ types_base = "types" shutil.rmtree(types_base, ignore_errors=True) shutil.rmtree(functions_base, ignore_errors=True) -with open(home + "/template/page.txt") as f: - page_template = f.read() - -with open(home + "/template/toctree.txt") as f: - toctree = f.read() - def generate(source_path, base): all_entities = {} @@ -110,6 +104,15 @@ def generate(source_path, base): def start(): + global page_template + global toctree + + with open(home + "/template/page.txt") as f: + page_template = f.read() + + with open(home + "/template/toctree.txt") as f: + toctree = f.read() + generate(types_path, types_base) generate(functions_path, functions_base)