Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nghyd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cassiopée
nghyd
Commits
28e936a4
Commit
28e936a4
authored
1 year ago
by
David Dorchies
Browse files
Options
Downloads
Patches
Plain Diff
docs: pdf build script optimisation
Refs
#656
parent
824f6726
Branches
master
No related tags found
2 merge requests
!252
release: version 4.18.0
,
!251
Resolve "Documentation PDF: erreurs à la compilation"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/mkdocs2pdf.py
+13
-12
13 additions, 12 deletions
scripts/mkdocs2pdf.py
with
13 additions
and
12 deletions
scripts/mkdocs2pdf.py
+
13
−
12
View file @
28e936a4
...
@@ -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 d
i
rectory
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment