Commit 89cddb88 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Utilise la version de @devatscience/reveal.js publiée sur NPM.

parent 9200a003
import { ASSET_GLOB, DEST_DIR, GRAPH_GLOB, PDF_GLOB, PREZ_GLOB, REVEALJS_URL } from "./config"; import del from 'del';
import { dest, lastRun, parallel, series, src } from "gulp"; import { dest, lastRun, parallel, series, src } from 'gulp';
import autoindex from "./plugins/autoindex";
import { build_revealjs } from "./revealjs"; import { ASSET_GLOB, DEST_DIR, GRAPH_GLOB, PDF_GLOB, PREZ_GLOB, REVEALJS_URL } from './config';
import del from "del"; import autoindex from './plugins/autoindex';
import drawio from "./plugins/drawio"; import drawio from './plugins/drawio';
import pandoc from "./plugins/pandoc"; import pandoc from './plugins/pandoc';
import spy from "./plugins/spy"; import spy from './plugins/spy';
import wkhtmltopdf from "./plugins/wkhtmltopdf"; import wkhtmltopdf from './plugins/wkhtmltopdf';
import revealjs from './revealjs';
export const clean = () => del(`${DEST_DIR}/**`, { force: true }); export const clean = () => del(`${DEST_DIR}/**`, { force: true });
...@@ -28,7 +29,7 @@ export const pdf = () => src(PDF_GLOB).pipe(wkhtmltopdf()).pipe(dest(DEST_DIR)). ...@@ -28,7 +29,7 @@ export const pdf = () => src(PDF_GLOB).pipe(wkhtmltopdf()).pipe(dest(DEST_DIR)).
export const build = series( export const build = series(
clean, clean,
parallel(build_revealjs, assets, prez, graphs), parallel(revealjs, assets, prez, graphs),
pdf pdf
); );
......
import { ASSET_GLOB, DEST_DIR, GRAPH_GLOB, PREZ_GLOB } from "./config"; import { parallel, series, src, watch } from 'gulp';
import build, { assets, graphs, pdf, prez } from "./build"; import server from 'gulp-server-livereload';
import { parallel, series, src, watch } from "gulp";
import server from "gulp-server-livereload"; import build, { assets, graphs, pdf, prez } from './build';
import { watch_revealjs } from "./revealjs"; import { ASSET_GLOB, DEST_DIR, GRAPH_GLOB, PREZ_GLOB } from './config';
import revealjs from './revealjs';
const serve = () => { const serve = () => {
src(DEST_DIR).pipe( src(DEST_DIR).pipe(
...@@ -24,15 +25,14 @@ const watch_pdf = () => watch(`${DEST_DIR}/**/*.{html,svg,jpg,gif,png}`, pdf); ...@@ -24,15 +25,14 @@ const watch_pdf = () => watch(`${DEST_DIR}/**/*.{html,svg,jpg,gif,png}`, pdf);
export const dev = series( export const dev = series(
build, build,
revealjs,
parallel( parallel(
serve, serve,
watch_prez, watch_prez,
watch_assets, watch_assets,
watch_graphs, watch_graphs,
watch_pdf, watch_pdf,
watch_revealjs
) )
); );
export default dev; export default dev;
import * as revealJS from "@inrae/reveal.js/gulpfile.esm"; import { dest, lastRun, src } from 'gulp';
import { dest, lastRun, parallel, series, src, watch } from "gulp"; import { magenta } from 'gulp-cli/lib/shared/ansi';
import { DEST_DIR, REVEALJS_URL } from "./config"; import logger from 'gulplog';
import logger from "gulplog"; import path from 'path';
import { magenta } from "gulp-cli/lib/shared/ansi";
import path from "path"; import { DEST_DIR, REVEALJS_URL } from './config';
import spy from "./plugins/spy"; import spy from './plugins/spy';
const noop = () => Promise.resolve(false); let revealjs = () => Promise.resolve(false)
export const [build_revealjs, watch_revealjs] = (function (url) { if (REVEALJS_URL.startsWith("http")) {
if (url.startsWith("http")) { logger.info(`Using remote reveal.js at ${magenta(REVEALJS_URL)} ($REVEALJS_URL)`);
logger.info(`Using remote reveal.js at ${magenta(REVEALJS_URL)} ($REVEALJS_URL)`);
return [noop, noop]; } else {
} const _SRC_DIR = path.normalize(`${__dirname}/../node_modules/@devatscience/reveal.js`);
const _SRC_DIR = path.normalize(`${__dirname}/../node_modules/@inrae/reveal.js/public`);
const SRC = `${_SRC_DIR}/**`; const SRC = `${_SRC_DIR}/**`;
const DST = path.normalize(DEST_DIR + "/" + url); const DST = path.normalize(DEST_DIR + "/" + REVEALJS_URL);
logger.info(`Using local ${DEST_DIR}/${magenta(path.relative(DEST_DIR, DST))} from ${path.relative(__dirname + '/..', _SRC_DIR + '/..')} ($REVEALJS_URL)`);
const copy_revealjs = () => revealjs = () =>
src(SRC, { since: lastRun(copy_revealjs) }).pipe(dest(DST)).pipe(spy()); src([SRC, "!**/package.json"], { since: lastRun(revealjs) }).pipe(dest(DST)).pipe(spy());
const _watch_revealjs = () => watch(SRC, copy_revealjs);
logger.info(`Building local ${DEST_DIR}/${magenta(path.relative(DEST_DIR, DST))} from ${path.relative(__dirname + '/..', _SRC_DIR + '/..')} ($REVEALJS_URL)`); }
return [ export default revealjs;
series(revealJS.build, copy_revealjs),
parallel(revealJS.dev, _watch_revealjs),
];
})(REVEALJS_URL);
This diff is collapsed.
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
"node": ">=12 <14" "node": ">=12 <14"
}, },
"dependencies": { "dependencies": {
"@inrae/reveal.js": "git+https://gitlab.irstea.fr/pole-is/tools/reveal.js.git#semver:^2.0", "@devatscience/reveal.js": "^2.0.0",
"del": "^5.1.0", "del": "^5.1.0",
"esm": "^3.2.25", "esm": "^3.2.25",
"gulp": "^4.0.2", "gulp": "^4.0.2",
......
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