From db231e07f8221fd0b3d40efd293c4cc7e02c274a Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Tue, 18 Sep 2018 12:31:02 -0500 Subject: [PATCH] Documentation should be generated in a folder called documentation --- doc/generator.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/generator.py b/doc/generator.py index a19ea972..1bdc1888 100644 --- a/doc/generator.py +++ b/doc/generator.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import markdown import os +import shutil from codecs import open as _open import languageHandler languageHandler.setLanguage("en") @@ -38,14 +39,18 @@ def generate_document(language, document_type="documentation"): """ % (language, title, title) first_html_block = first_html_block+ markdown_file first_html_block = first_html_block + "\n\n" - if not os.path.exists(language): - os.mkdir(language) - mdfile = _open("%s/%s" % (language, filename), "w", encoding="utf-8") + if not os.path.exists(os.path.join("documentation", language)): + os.mkdir(os.path.join("documentation", language)) + mdfile = _open(os.path.join("documentation", language, filename), "w", encoding="utf-8") mdfile.write(first_html_block) mdfile.close() def create_documentation(): print("Creating documentation in the supported languages...\n") + if not os.path.exists("documentation"): + os.mkdir("documentation") + if os.path.exists(os.path.join("documentation", "license.txt")) == False: + shutil.copy(os.path.join("..", "license.txt"), os.path.join("documentation", "license.txt")) for i in languages: print("Creating documentation for: %s" % (i,)) generate_document(i)