Commit 95709e58 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Utilise directement les sources de pole-is/tools/reveal.js (branche gulp).

No related merge requests found
Showing with 3571 additions and 149 deletions
+3571 -149
......@@ -3,9 +3,12 @@ import del from "del";
import drawio from "./lib/drawio";
import index from "./lib/index";
import pandoc from "./lib/pandoc";
import path from "path";
import revealjs from "@irstea/reveal.js/gulpfile.esm";
import server from "gulp-server-livereload";
import wkhtmltopdf from "./lib/wkhtmltopdf";
const REVEALJS_URL = process.env.REVEALJS_URL || "reveal.js";
const SRC_DIR = process.env.SRC || "src";
const DEST_DIR = process.env.OUTPUT || "public";
......@@ -21,18 +24,33 @@ export const clean = () => del(`${DEST_DIR}/**`, { force: true });
export const assets = () =>
src(ASSET_GLOB, { since: lastRun(assets) }).pipe(dest(DEST_DIR));
export const prez = () =>
src(PREZ_GLOB, { since: lastRun(prez) })
.pipe(index())
.pipe(pandoc())
.pipe(pandoc({ variables: { "revealjs-url": REVEALJS_URL } }))
.pipe(dest(DEST_DIR));
export const graphs = () =>
src(GRAPH_GLOB, { since: lastRun(graphs) })
.pipe(drawio())
.pipe(dest(DEST_DIR));
export const pdf = () => src(PDF_GLOB).pipe(wkhtmltopdf()).pipe(dest(DEST_DIR));
export const build = series(clean, parallel(assets, prez, graphs), pdf);
export const library = !REVEALJS_URL.startsWith("http")
? series(revealjs, () =>
src(__dirname + "/node_modules/@irstea/reveal.js/public/**").pipe(
dest(path.join(DEST_DIR, REVEALJS_URL))
)
)
: () => false;
export const build = series(
clean,
parallel(library, assets, prez, graphs),
pdf
);
const serve = () => {
src(DEST_DIR).pipe(
......
import gulpPandoc from "gulp-pandoc";
import { merge } from "merge-anything";
const REVEALJS_URL =
process.env.REVEALJS_URL ||
"https://pole-is.gitlab.irstea.page/tools/reveal.js";
const DEFAULTS = {
slideLevel: 2,
tocDepth: 2,
variables: {
"revealjs-url": "reveal.js",
width: 1024,
height: 768,
navigationMode: "linear",
theme: "inrae",
slideNumber: true,
history: true,
fragmentInURL: true,
},
};
export default function pandoc() {
export default function pandoc(options = {}) {
const { slideLevel, tocDepth, variables } = merge({}, DEFAULTS, options);
return gulpPandoc({
from:
"markdown+backtick_code_blocks+pandoc_title_block+yaml_metadata_block",
......@@ -12,17 +25,12 @@ export default function pandoc() {
ext: ".html",
args: [
"--standalone",
"--slide-level=2",
`--slide-level=${slideLevel}`,
"--toc",
"--toc-depth=2",
`--variable=revealjs-url:${REVEALJS_URL}`,
"--variable=width:1024",
"--variable=height:768",
"--variable=history:true",
"--variable=navigationMode:linear",
"--variable=fragmentInURL:true",
"--variable=theme:inrae",
"--variable=slideNumber:true",
`--toc-depth=${tocDepth}`,
...Object.getOwnPropertyNames(variables).map(
(name) => `--variable=${name}:${variables[name]}`
),
],
});
}
This diff is collapsed.
......@@ -18,12 +18,14 @@
"node": ">=12 <14"
},
"dependencies": {
"@irstea/reveal.js": "git+https://gitlab.irstea.fr/pole-is/tools/reveal.js.git#gulp",
"del": "^5.1.0",
"esm": "^3.2.25",
"gulp": "^4.0.2",
"gulp-pandoc": "^0.2.2",
"gulp-server-livereload": "^1.9.2",
"gulplog": "^1.0.0",
"merge-anything": "^3.0.3",
"plugin-error": "^1.0.1",
"through2": "^3.0.1",
"vinyl": "^2.2.0",
......
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