# -*- 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 languages = ["en", "es"] def generate_document(language, document_type="documentation"): reload(languageHandler) 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 = """