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
No related merge requests found
Showing with 20 additions and 5 deletions
+20 -5
...@@ -58,6 +58,8 @@ module.exports = grunt => { ...@@ -58,6 +58,8 @@ module.exports = grunt => {
build: { build: {
cmd: (pres, env) => cmd: (pres, env) =>
[ [
env === "dev" && "set -x ; ",
`[ -s '../src/${pres}.conf' ] && . ../src/${pres}.conf ;`,
"pandoc", "pandoc",
"--verbose", "--verbose",
"--from=markdown+smart", "--from=markdown+smart",
...@@ -66,14 +68,15 @@ module.exports = grunt => { ...@@ -66,14 +68,15 @@ module.exports = grunt => {
`--output=./${pres}${env !== "prod" ? "-" + env : ""}.html`, `--output=./${pres}${env !== "prod" ? "-" + env : ""}.html`,
"--standalone", "--standalone",
"--toc", "--toc",
`--toc-depth=${TOC_DEPTH}`, "--toc-depth=$TOC_DEPTH",
`--slide-level=${SLIDE_LEVEL}`, "--slide-level=$SLIDE_LEVEL",
"--variable=lang:fr-FR", "--variable=lang:fr-FR",
`--variable=revealjs-url:${relative(dirname(pres), "./reveal.js")}`, `--variable=revealjs-url:${relative(dirname(pres), "./reveal.js")}`,
"--variable=theme:irstea", "--variable=theme:irstea",
"--variable=history:true", "--variable=history:true",
"--variable=navigationMode:linear", "--variable=navigationMode:linear",
"--variable=fragmentInURL:true", "--variable=fragmentInURL:true",
"$PANDOC_ARGS",
env === "dev" && env === "dev" &&
`--variable=header-includes:"<script src='//${PUBLIC_HOST}:${LIVERELOAD_PORT}/livereload.js'></script>"` `--variable=header-includes:"<script src='//${PUBLIC_HOST}:${LIVERELOAD_PORT}/livereload.js'></script>"`
] ]
...@@ -81,7 +84,14 @@ module.exports = grunt => { ...@@ -81,7 +84,14 @@ module.exports = grunt => {
.join(" "), .join(" "),
cwd: "dist", cwd: "dist",
stdout: true, 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 => { ...@@ -132,8 +142,13 @@ module.exports = grunt => {
grunt.registerTask("build:pres", function(env) { grunt.registerTask("build:pres", function(env) {
const done = this.async(); const done = this.async();
readdirp readdirp
.promise("src/", { fileFilter: "*.md" }) .promise("src/.", { fileFilter: "*.md" })
.then(entries => enqueueBuilds(entries.map(entry => entry.path), env)) .then(entries =>
enqueueBuilds(
entries.map(entry => entry.path),
env
)
)
.then(done, err => { .then(done, err => {
grunt.log.error(err); grunt.log.error(err);
done(false); done(false);
......
Supports Markdown
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