Skip to content
Snippets Groups Projects
Commit 28e936a4 authored by David Dorchies's avatar David Dorchies
Browse files

docs: pdf build script optimisation

Refs #656
parent 824f6726
No related branches found
No related tags found
2 merge requests!252release: version 4.18.0,!251Resolve "Documentation PDF: erreurs à la compilation"
......@@ -160,7 +160,7 @@ def getLatexModel():
os.chdir(os.path.dirname(os.getcwd()))
else:
runCommand('git clone {} {}'.format(latexModelRepository, latexModelDir))
# back to original working drectory
# back to original working directory
os.chdir(baseDir)
# Inject generated merged documentation and necessary resources (template, logos…)
......@@ -210,11 +210,6 @@ def buildPDF(lang):
# Creates the PDF documentation file for the given language
def buildDocForLang(lang):
# Prepare temporary build directory
createEmptyDir(pdfBuildDir)
# Prepare output directory
createDir(outputDir)
# Read config
yamlPath = 'mkdocs/mkdocs-' + lang + '.yml'
dMkdocsYaml = readConfig(yamlPath)
......@@ -232,20 +227,26 @@ def buildDocForLang(lang):
# Convert to tex format
convertMdToTex(mergedDocOutputPath)
# Get INRAE report LaTeX model and inject merged content inside
getLatexModel()
# Inject merged content inside Latex model
injectContentIntoModel(mergedDocFilename + '.tex', lang)
# Build PDF from LaTeX source
buildPDF(lang)
# Clean build dir
if not verbose: shutil.rmtree(pdfBuildDir)
#raise RuntimeError()
if __name__ == '__main__':
# Prepare temporary build directory
createEmptyDir(pdfBuildDir)
# Prepare output directory
createDir(outputDir)
# Get INRAE report LaTeX model
getLatexModel()
for l in ['fr', 'en']:
print('building PDF doc for language "{}"'.format(l))
buildDocForLang(l)
# Clean build dir
if not verbose: shutil.rmtree(pdfBuildDir)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment