diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61f48ad..3847e28 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,6 @@ production: - python documentation_importer.py - cd ..\src - python ..\doc\generator.py - - copy ..\license.txt documentation\license.txt - python setup.py py2exe - cd .. - cd scripts diff --git a/doc/generator.py b/doc/generator.py index dd60064..e55d40c 100644 --- a/doc/generator.py +++ b/doc/generator.py @@ -1,21 +1,32 @@ # -*- coding: utf-8 -*- import markdown import os +import shutil from codecs import open as _open import languageHandler languageHandler.setLanguage("en") +import strings +import changelog -# the list of supported language codes of TW Blue +# the list of supported language codes languages = ["en", "es"] -def generate_document(language): - if os.path.exists("documentation") == False: - os.mkdir("documentation") - import strings +def generate_document(language, document_type="documentation"): reload(languageHandler) - languageHandler.setLanguage(language) - reload(strings) - markdown_file = markdown.markdown("\n".join(strings.documentation[1:]), extensions=["markdown.extensions.toc"]) + if document_type == "documentation": + translation_file = "socializer-documentation" + languageHandler.setLanguage(language, translation_file) + reload(strings) + markdown_file = markdown.markdown("\n".join(strings.documentation[1:]), extensions=["markdown.extensions.toc"]) + title = strings.documentation[0] + filename = "manual.html" + elif document_type == "changelog": + translation_file = "socializer-changelog" + languageHandler.setLanguage(language, translation_file) + reload(changelog) + markdown_file = markdown.markdown("\n".join(changelog.documentation[1:]), extensions=["markdown.extensions.toc"]) + title = changelog.documentation[0] + filename = "changelog.html" first_html_block = """
@@ -24,20 +35,25 @@ def generate_document(language):