-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.patchouli.js
69 lines (56 loc) · 1.59 KB
/
.patchouli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const path = require('path');
const os = require('os');
const {uid, gid} = os.userInfo();
const patchouly_root = "/opt/src";
let config = {
docker: {
mount_cwd: `-v ${process.cwd()}:/source`,
mount_tmp: `-v /tmp:/tmp`,
extra_mounts: [],
image: ` --rm kotborealis/patchouli:latest`,
},
default_pandoc: [
`-f`, `markdown+yaml_metadata_block+smart+fancy_lists+raw_tex-auto_identifiers`,
'--standalone',
'--toc',
],
default_tex: [
`--template=${path.join(patchouly_root, 'resources', './default.latex')}`,
],
default_docx: [
],
default_revealjs: [
`--template=${path.join(patchouly_root, 'resources', './default.revealjs')}`,
`-V`, `revealjs-url=https://awooo.ru/reveal.js`,
`--slide-level`, `2`,
`-t`, `revealjs`
],
pandoc: [],
tex: [],
docx: [],
revealjs: [],
output_dir: '.out',
output: 'build.md',
args: {},
output_ext_mapping: {
revealjs: "html"
},
literate: false
};
config = Object.assign(config, {
docker_cmd: cmd => `docker run
--user="${uid}:${gid}"
--net=none
--pid=host
--uts=host
${config.docker.mount_cwd}
${config.docker.mount_tmp}
${config.docker.extra_mounts.map(i => `-v ${i}`).join(' ')}
${config.docker.image}
/bin/bash -c "${
cmd.join(" && ").replace(/"/g, "\\\"")
}"`.replace(/\n/g, ''),
pandoc_cmd: `/usr/bin/pandoc -s `,
xelatex_cmd: `xelatex -output-directory=${config.output_dir} `
});
module.exports = config;