From 1eac6535f500d61eb2e7448f5dc71e36357e42f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Wed, 12 Oct 2022 12:08:16 +0200
Subject: [PATCH 1/2] fix(doc): remove scrollbars on Mathjax formulas

refs #461
---
 docs/mathjax-scrollbar.css | 9 +++++++++
 mkdocs-en.yml              | 2 ++
 mkdocs-fr.yml              | 2 ++
 3 files changed, 13 insertions(+)
 create mode 100644 docs/mathjax-scrollbar.css

diff --git a/docs/mathjax-scrollbar.css b/docs/mathjax-scrollbar.css
new file mode 100644
index 000000000..1609cabff
--- /dev/null
+++ b/docs/mathjax-scrollbar.css
@@ -0,0 +1,9 @@
+/* suppression de l'ascenseur horizontal sur les formules Mathjax */
+.arithmatex {
+    overflow-x: auto;
+}
+
+/* suppression de l'ascenseur vertical sur certaines formules Mathjax */
+mjx-math {
+    overflow-y: clip;
+}
diff --git a/mkdocs-en.yml b/mkdocs-en.yml
index fc9fc321d..23d32b54e 100644
--- a/mkdocs-en.yml
+++ b/mkdocs-en.yml
@@ -9,6 +9,8 @@ theme:
     name: 'material'
     language: 'en'
 use_directory_urls: false
+extra_css:
+    - ../stylesheets/mathjax-scrollbar.css
 extra_javascript:
     - ../javascripts/mathjax.config.js
     - ../javascripts/mathjax/tex-mml-chtml.js
diff --git a/mkdocs-fr.yml b/mkdocs-fr.yml
index e32b6f3f8..4d6aa5fb2 100644
--- a/mkdocs-fr.yml
+++ b/mkdocs-fr.yml
@@ -9,6 +9,8 @@ theme:
     name: 'material'
     language: 'fr'
 use_directory_urls: false
+extra_css:
+    - ../stylesheets/mathjax-scrollbar.css
 extra_javascript:
     - ../javascripts/mathjax.config.js
     - ../javascripts/mathjax/tex-mml-chtml.js
-- 
GitLab


From 2c21af2e89aaa2ddef59d934504a489b96a66cf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Wed, 12 Oct 2022 12:08:55 +0200
Subject: [PATCH 2/2] fix(doc): Mathjax formulas not displayed when application
 is run locally

refs #461
---
 scripts/mkdocs-postprocess.js | 46 ++++++++++++++++++++++++++++-------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/scripts/mkdocs-postprocess.js b/scripts/mkdocs-postprocess.js
index 0e929e545..61d0abe11 100644
--- a/scripts/mkdocs-postprocess.js
+++ b/scripts/mkdocs-postprocess.js
@@ -6,24 +6,52 @@
 
 const fs = require('fs-extra');
 
-const destPath = "src/assets/docs/javascripts";
-const destPathMJ = destPath + "/mathjax";
+const destPath_JS = "src/assets/docs/javascripts";
+const destPath_FR_JS = "src/assets/docs/fr/javascripts"; // pour la compilation en local (français)
+const destPath_EN_JS = "src/assets/docs/fr/javascripts"; // pour la compilation en local (anglais)
+
+const destPath_CSS = "src/assets/docs/stylesheets";
+const destPath_FR_CSS = "src/assets/docs/fr/stylesheets"; // pour la compilation en local (français)
+const destPath_EN_CSS = "src/assets/docs/en/stylesheets"; // pour la compilation en local (anglais)
+
+const destPath_JS_MJ = destPath_JS + "/mathjax";
+const destPath_FR_JS_MJ = destPath_FR_JS + "/mathjax"; // pour la compilation en local (français)
+const destPath_EN_JS_MJ = destPath_EN_JS + "/mathjax"; // pour la compilation en local (anglais)
 
 // empty destination folder
-fs.emptyDirSync(destPath);
+fs.emptyDirSync(destPath_JS);
 
 // create destination subfolders
-fs.ensureDirSync(destPathMJ + "/fonts/HTML-CSS/TeX/", { recursive: true });
+fs.ensureDirSync(destPath_JS_MJ + "/fonts/HTML-CSS/TeX/", { recursive: true });
 
 // copy required files only
-fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPathMJ + "/tex-mml-chtml.js");
-fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPathMJ + "/output/chtml/fonts");
+fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_JS_MJ + "/tex-mml-chtml.js");
+fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_FR_JS_MJ + "/tex-mml-chtml.js");
+fs.copySync("node_modules/mathjax/es5/tex-mml-chtml.js", destPath_EN_JS_MJ + "/tex-mml-chtml.js");
+
+fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_JS_MJ + "/output/chtml/fonts");
+fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_FR_JS_MJ + "/output/chtml/fonts");
+fs.copySync("node_modules/mathjax/es5/output/chtml/fonts", destPath_EN_JS_MJ + "/output/chtml/fonts");
+
+fs.copySync("docs/mathjax.config.js", destPath_JS + "/mathjax.config.js");
+fs.copySync("docs/mathjax.config.js", destPath_FR_JS + "/mathjax.config.js");
+fs.copySync("docs/mathjax.config.js", destPath_EN_JS + "/mathjax.config.js");
+
+fs.copySync("docs/mathjax-scrollbar.css", destPath_JS + "/mathjax.config.js");
+fs.copySync("docs/mathjax.config.js", destPath_FR_JS + "/mathjax.config.js");
+fs.copySync("docs/mathjax.config.js", destPath_EN_JS + "/mathjax.config.js");
 
-fs.copySync("docs/mathjax.config.js", destPath + "/mathjax.config.js");
+fs.copySync("docs/mathjax-scrollbar.css", destPath_CSS + "/mathjax-scrollbar.css");
+fs.copySync("docs/mathjax-scrollbar.css", destPath_FR_CSS + "/mathjax-scrollbar.css");
+fs.copySync("docs/mathjax-scrollbar.css", destPath_EN_CSS + "/mathjax-scrollbar.css");
 
-fs.copySync("docs/matomo-tracking.js", destPath + "/matomo-tracking.js");
+fs.copySync("docs/matomo-tracking.js", destPath_JS + "/matomo-tracking.js");
+fs.copySync("docs/matomo-tracking.js", destPath_FR_JS + "/matomo-tracking.js");
+fs.copySync("docs/matomo-tracking.js", destPath_EN_JS + "/matomo-tracking.js");
 
-fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath + "/mermaid.min.js");
+fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_JS + "/mermaid.min.js");
+fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_FR_JS + "/mermaid.min.js");
+fs.copySync("node_modules/mermaid/dist/mermaid.min.js", destPath_EN_JS + "/mermaid.min.js");
 
 // copy illustrated guide (not related to MkDocs, but still a part of the doc)
 fs.copySync("docs/cassiopee_notice_illustree_fr.pdf", "src/assets/docs/pdf/cassiopee_notice_illustree_fr.pdf");
-- 
GitLab