Skip to content
Snippets Groups Projects
Commit 8c4dfcc8 authored by François Grand's avatar François Grand
Browse files

fix(doc): french PDF erased during documentation generation

parent d74e9a8c
No related branches found
No related tags found
No related merge requests found
Pipeline #142510 passed
......@@ -15,8 +15,8 @@
"e2equick": "node scripts/check-translations.js && ./node_modules/.bin/wdio run ./wdio.conf.ts",
"monkeytest": "npm run ng -- e2e --dev-server-target= --suite=monkeyTest --webdriver-update=false",
"mkdocs": "bash scripts/prepare_mkdocs.sh; cd build; python3 -m mkdocs build -f mkdocs-fr.yml && python3 -m mkdocs build -f mkdocs-en.yml && cd .. && node scripts/mkdocs-postprocess.js",
"mkdocs2pdf": "node scripts/extract-nghyd-version.js build/cassiopee_version.tex && python3 scripts/mkdocs2pdf.py && node scripts/mkdocs2pdf-postprocess.js",
"clean": "rm -rf build dist release src/date_revision.ts src/assets/docs",
"mkdocs2pdf": "node scripts/extract-nghyd-version.js build/cassiopee_version.tex && python3 scripts/mkdocs2pdf.py && node scripts/mkdocs2pdf-postprocess.js && bash scripts/check-pdf-docs.sh",
"clean": "rm -rf build dist release src/date_revision.ts src/assets/docs docs/pdf_build",
"preprocess": "mkdir -p build; node scripts/preprocessors.js; npm run service-worker-version; bash scripts/fix-chartjs-plugin-zoom-2.0.0.sh",
"start": "npm run preprocess && npm run mkdocs && npm run ng serve -- --host 127.0.0.1 --poll 5000",
"build-no-pdf": "npm run preprocess && npm run mkdocs && npm run ng build -- --configuration production",
......
#!/bin/bash
# check that PDF doc files are generated
# error on unset variables
set -o nounset
# exit on error
set -o errexit
function check_file()
{
if [[ ! -f $1 ]]; then
echo "$1 : missing documentation file" >&2
exit 1
fi
}
check_file dist/assets/docs/pdf/cassiopee_notice_illustree_fr.pdf
check_file dist/assets/docs/pdf/cassiopee_doc_fr.pdf
check_file dist/assets/docs/pdf/cassiopee_doc_en.pdf
......@@ -56,6 +56,10 @@ def createEmptyDir(path):
shutil.rmtree(path)
os.makedirs(path)
def createDir(path):
if not os.path.exists(path):
os.makedirs(path)
# Reads an MkDocs configuration file
def readConfig(sYAML):
f = open(sYAML, 'r')
......@@ -210,7 +214,7 @@ def buildDocForLang(lang):
# Prepare temporary build directory
createEmptyDir(pdfBuildDir)
# Prepare output directory
createEmptyDir(outputDir)
createDir(outputDir)
# Read config
yamlPath = 'mkdocs/mkdocs-' + lang + '.yml'
......
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