'use strict'; /** * copies extra javascripts (MathJax, matomo-tracking) to src/assets/docs/javascripts after doc was built by MkDocs */ const fs = require('fs-extra'); 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_JS); // create destination subfolders 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", 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-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_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_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");