Commit 935c09ac authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Ajoute la possibilité de configurer Pandoc par présentation.

parent 9b473fb9
......@@ -58,6 +58,8 @@ module.exports = grunt => {
build: {
cmd: (pres, env) =>
[
env === "dev" && "set -x ; ",
`[ -s '../src/${pres}.conf' ] && . ../src/${pres}.conf ;`,
"pandoc",
"--verbose",
"--from=markdown+smart",
......@@ -66,14 +68,15 @@ module.exports = grunt => {
`--output=./${pres}${env !== "prod" ? "-" + env : ""}.html`,
"--standalone",
"--toc",
`--toc-depth=${TOC_DEPTH}`,
`--slide-level=${SLIDE_LEVEL}`,
"--toc-depth=$TOC_DEPTH",
"--slide-level=$SLIDE_LEVEL",
"--variable=lang:fr-FR",
`--variable=revealjs-url:${relative(dirname(pres), "./reveal.js")}`,
"--variable=theme:irstea",
"--variable=history:true",
"--variable=navigationMode:linear",
"--variable=fragmentInURL:true",
"$PANDOC_ARGS",
env === "dev" &&
`--variable=header-includes:"<script src='//${PUBLIC_HOST}:${LIVERELOAD_PORT}/livereload.js'></script>"`
]
......@@ -81,7 +84,14 @@ module.exports = grunt => {
.join(" "),
cwd: "dist",
stdout: true,
stderr: true
stderr: true,
options: {
env: {
TOC_DEPTH: "" + TOC_DEPTH,
SLIDE_LEVEL: "" + SLIDE_LEVEL,
PANDOC_ARGS: ""
}
}
}
},
......@@ -132,8 +142,13 @@ module.exports = grunt => {
grunt.registerTask("build:pres", function(env) {
const done = this.async();
readdirp
.promise("src/", { fileFilter: "*.md" })
.then(entries => enqueueBuilds(entries.map(entry => entry.path), env))
.promise("src/.", { fileFilter: "*.md" })
.then(entries =>
enqueueBuilds(
entries.map(entry => entry.path),
env
)
)
.then(done, err => {
grunt.log.error(err);
done(false);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment