|
1 | | -const path = require('path'); |
2 | | -const shell = require('shelljs'); |
3 | | - |
4 | | -const convert = require('@mborne/markdown-to-html').convert; |
5 | | - |
6 | | -console.log('rm -rf public...'); |
7 | | -shell.rm('-rf',path.resolve(__dirname,'public')); |
8 | | - |
9 | | -const options = { |
10 | | - language: "fr" |
11 | | -} |
12 | | - |
13 | | -console.log('src/slides -> public with layout/slides...'); |
14 | | -convert( |
15 | | - path.resolve(__dirname,'src/slides'), |
16 | | - path.resolve(__dirname,'public'), |
17 | | - path.resolve(__dirname,'layout/slides'), |
18 | | - options |
19 | | -); |
20 | | - |
21 | | -console.log('src/annexe -> public/annexe with default layout...'); |
22 | | -convert( |
23 | | - path.resolve(__dirname,'src/annexe'), |
24 | | - path.resolve(__dirname,'public/annexe'), |
25 | | - path.resolve(__dirname,'layout/annexe'), |
26 | | - options |
27 | | -); |
| 1 | +const path = require('path'); |
| 2 | +const shell = require('shelljs'); |
| 3 | + |
| 4 | +const {Marpit} = require('@marp-team/marpit'); |
| 5 | +const fs = require('fs'); |
| 6 | + |
| 7 | +console.log('rm -rf public...'); |
| 8 | +shell.rm('-rf',path.resolve(__dirname,'public')); |
| 9 | + |
| 10 | +const options = { |
| 11 | + language: "fr" |
| 12 | +} |
| 13 | + |
| 14 | + |
| 15 | +/* |
| 16 | + * Render slides using marp-cli |
| 17 | + * https://github.com/marp-team/marp-cli#readme |
| 18 | + */ |
| 19 | +console.log('src/slides -> public ...'); |
| 20 | +shell.exec('npx marp --html=true --theme ./src/slides/marp-ensg.css -I ./src/slides/ -o ./public/'); |
| 21 | +/* |
| 22 | + * Copy src/slides/img to public/img |
| 23 | + */ |
| 24 | +console.log('src/slides/img -> public/img ...'); |
| 25 | +shell.cp('-r',path.resolve(__dirname,'src/slides/img'),path.resolve(__dirname,'public/.')) |
| 26 | + |
| 27 | +/* |
| 28 | + * Render src/annexe to public/annexe |
| 29 | + */ |
| 30 | +const convert = require('@mborne/markdown-to-html').convert; |
| 31 | + |
| 32 | +console.log('src/annexe -> public/annexe with default layout...'); |
| 33 | +convert( |
| 34 | + path.resolve(__dirname,'src/annexe'), |
| 35 | + path.resolve(__dirname,'public/annexe'), |
| 36 | + path.resolve(__dirname,'layout/annexe'), |
| 37 | + options |
| 38 | +); |
0 commit comments