Newer
Older
'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 = "src/assets/docs/javascripts";
const destPathMJ = destPath + "/mathjax";
// empty destination folder
fs.emptyDirSync(destPath);
// create destination subfolders
fs.ensureDirSync(destPathMJ + "/fonts/HTML-CSS/TeX/", { recursive: true });
// copy required files only
fs.copySync("node_modules/mathjax/MathJax.js", destPathMJ + "/MathJax.js");
fs.copySync("node_modules/mathjax/config", destPathMJ + "/config");
fs.copySync("node_modules/mathjax/jax", destPathMJ + "/jax");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/woff", destPathMJ + "/fonts/HTML-CSS/TeX/woff");
fs.copySync("node_modules/mathjax/fonts/HTML-CSS/TeX/otf", destPathMJ + "/fonts/HTML-CSS/TeX/otf");
fs.copySync("docs/matomo-tracking.js", destPath + "/matomo-tracking.js");