mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Documentation should be generated in a folder called documentation
This commit is contained in:
parent
eaf13a4453
commit
db231e07f8
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import markdown
|
import markdown
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
from codecs import open as _open
|
from codecs import open as _open
|
||||||
import languageHandler
|
import languageHandler
|
||||||
languageHandler.setLanguage("en")
|
languageHandler.setLanguage("en")
|
||||||
@ -38,14 +39,18 @@ def generate_document(language, document_type="documentation"):
|
|||||||
""" % (language, title, title)
|
""" % (language, title, title)
|
||||||
first_html_block = first_html_block+ markdown_file
|
first_html_block = first_html_block+ markdown_file
|
||||||
first_html_block = first_html_block + "\n</body>\n</html>"
|
first_html_block = first_html_block + "\n</body>\n</html>"
|
||||||
if not os.path.exists(language):
|
if not os.path.exists(os.path.join("documentation", language)):
|
||||||
os.mkdir(language)
|
os.mkdir(os.path.join("documentation", language))
|
||||||
mdfile = _open("%s/%s" % (language, filename), "w", encoding="utf-8")
|
mdfile = _open(os.path.join("documentation", language, filename), "w", encoding="utf-8")
|
||||||
mdfile.write(first_html_block)
|
mdfile.write(first_html_block)
|
||||||
mdfile.close()
|
mdfile.close()
|
||||||
|
|
||||||
def create_documentation():
|
def create_documentation():
|
||||||
print("Creating documentation in the supported languages...\n")
|
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:
|
for i in languages:
|
||||||
print("Creating documentation for: %s" % (i,))
|
print("Creating documentation for: %s" % (i,))
|
||||||
generate_document(i)
|
generate_document(i)
|
||||||
|
Loading…
Reference in New Issue
Block a user