2020-01-30 23:05:23 +02:00
|
|
|
const fs = require('fs-extra');
|
2020-02-05 00:09:34 +02:00
|
|
|
const { dirname } = require('../pathUtils');
|
2020-01-30 23:05:23 +02:00
|
|
|
|
|
|
|
const rootDir = dirname(__dirname);
|
|
|
|
const assetsDir = `${rootDir}/assets`;
|
|
|
|
|
|
|
|
async function copyFile(source, dest) {
|
|
|
|
const fullDest = `${assetsDir}/${dest}`;
|
|
|
|
const dir = dirname(fullDest);
|
|
|
|
await fs.mkdirp(dir);
|
|
|
|
await fs.copy(source, fullDest);
|
|
|
|
}
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
await fs.remove(assetsDir);
|
|
|
|
|
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/katex.min.css`, 'katex/katex.css');
|
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/fonts/KaTeX_Main-Regular.woff2`, 'katex/fonts/KaTeX_Main-Regular.woff2');
|
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/fonts/KaTeX_Math-Italic.woff2`, 'katex/fonts/KaTeX_Math-Italic.woff2');
|
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/fonts/KaTeX_Size1-Regular.woff2`, 'katex/fonts/KaTeX_Size1-Regular.woff2');
|
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/fonts/KaTeX_Size2-Regular.woff2`, 'katex/fonts/KaTeX_Size2-Regular.woff2');
|
2020-02-11 00:26:25 +02:00
|
|
|
await copyFile(`${rootDir}/node_modules/katex/dist/fonts/KaTeX_AMS-Regular.woff2`, 'katex/fonts/KaTeX_AMS-Regular.woff2');
|
2020-01-30 23:05:23 +02:00
|
|
|
|
|
|
|
await copyFile(`${rootDir}/node_modules/highlight.js/styles/atom-one-light.css`, 'highlight.js/atom-one-light.css');
|
|
|
|
await copyFile(`${rootDir}/node_modules/highlight.js/styles/atom-one-dark-reasonable.css`, 'highlight.js/atom-one-dark-reasonable.css');
|
2020-02-12 00:27:34 +02:00
|
|
|
|
|
|
|
await copyFile(`${rootDir}/node_modules/mermaid/dist/mermaid.min.js`, 'mermaid/mermaid.min.js');
|
|
|
|
await copyFile(`${rootDir}/MdToHtml/rules/mermaid_render.js`, 'mermaid/mermaid_render.js');
|
2020-01-30 23:05:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
main().catch((error) => {
|
|
|
|
console.error(error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|