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
Branches master
No related tags found
2 merge requests!252release: version 4.18.0,!251Resolve "Documentation PDF: erreurs à la compilation"
...@@ -160,7 +160,7 @@ def getLatexModel(): ...@@ -160,7 +160,7 @@ def getLatexModel():
os.chdir(os.path.dirname(os.getcwd())) os.chdir(os.path.dirname(os.getcwd()))
else: else:
runCommand('git clone {} {}'.format(latexModelRepository, latexModelDir)) runCommand('git clone {} {}'.format(latexModelRepository, latexModelDir))
# back to original working drectory # back to original working directory
os.chdir(baseDir) os.chdir(baseDir)
# Inject generated merged documentation and necessary resources (template, logos…) # Inject generated merged documentation and necessary resources (template, logos…)
...@@ -210,11 +210,6 @@ def buildPDF(lang): ...@@ -210,11 +210,6 @@ def buildPDF(lang):
# Creates the PDF documentation file for the given language # Creates the PDF documentation file for the given language
def buildDocForLang(lang): def buildDocForLang(lang):
# Prepare temporary build directory
createEmptyDir(pdfBuildDir)
# Prepare output directory
createDir(outputDir)
# Read config # Read config
yamlPath = 'mkdocs/mkdocs-' + lang + '.yml' yamlPath = 'mkdocs/mkdocs-' + lang + '.yml'
dMkdocsYaml = readConfig(yamlPath) dMkdocsYaml = readConfig(yamlPath)
...@@ -232,20 +227,26 @@ def buildDocForLang(lang): ...@@ -232,20 +227,26 @@ def buildDocForLang(lang):
# Convert to tex format # Convert to tex format
convertMdToTex(mergedDocOutputPath) convertMdToTex(mergedDocOutputPath)
# Get INRAE report LaTeX model and inject merged content inside # Inject merged content inside Latex model
getLatexModel()
injectContentIntoModel(mergedDocFilename + '.tex', lang) injectContentIntoModel(mergedDocFilename + '.tex', lang)
# Build PDF from LaTeX source # Build PDF from LaTeX source
buildPDF(lang) buildPDF(lang)
# Clean build dir
if not verbose: shutil.rmtree(pdfBuildDir)
#raise RuntimeError()
if __name__ == '__main__': 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']: for l in ['fr', 'en']:
print('building PDF doc for language "{}"'.format(l)) print('building PDF doc for language "{}"'.format(l))
buildDocForLang(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