zenika/sensei
The compiler for our training material. Sensei is a replacement for zenika-formation-framework.
Pull the image with docker image pull zenika/sensei
Create an alias sensei
alias sensei='docker container run \
--pull always \
--interactive \
--tty \
--rm \
--volume $(pwd):/$(basename $(pwd)) \
--workdir /$(basename $(pwd)) \
--publish ${SENSEI_PORT:-8080}:${SENSEI_PORT:-8080} \
--env SENSEI_PORT \
--cap-add=SYS_ADMIN \
zenika/sensei'
⚠ When running sensei inside a Docker container, the
--material
is limited to descendants of the working directory.
⚠ To change
SENSEI_PORT
when using this alias, use the following syntax:export SENSEI_PORT=9000; sensei
. See here.
Notes on running in Docker for Windows
When bind-mounting files in Docker for Windows with WSL2,
the recommendation
is to store files in the Linux filesystem, i.e. inside WSL2.
The Linux filesystem can then be accessed from Windows through the path \\wsl$\
(or \\wsl.localhost\
).
When using VSCode, you can also use the WSL extension
to edit files on the Linux filesystem.
Therefore it is recommended to clone the training repository in the Linux filesystem then to run the alias from WSL2.
⚠ If you use the Windows filesystem, hot reload when changing training content won't work.
⚠ If you use the Windows filesystem and expect to use the alias within Git Bash for Windows, prepend the
--volume
and--workdir
options with an additional slash (i.e.--volume /$(pwd):/$(basename $(pwd)) --workdir //$(basename $(pwd)
). See known issues of Git for Windows. This avoids theC:/Program Files/Git/...: no such file or directory
kind of errors.
cd
into the created folderdocker image build --tag zenika/sensei ./
--pull always
⚠ The same warnings as for the published Docker image apply.
npm install --global https://github.com/Zenika/sensei
⚠ You may use Yarn, however it's been known to have cache issues when installing packages from GitHub, resulting in failures to update sensei correctly.
Run sensei --help
for available commands and options.
cd
into a training material folder (must have Slides/slides.json
and
Workbook/workbook.json
)sensei pdf
pdf
foldercd
into a training material folder (must have Slides/slides.json
and
Workbook/workbook.json
)sensei serve
http://localhost:8080/
Write slides as you would usual Reveal.js slides. Refer to Reveal's documentation for features. Note that the following plugins are enabled:
Write the workbook as you would a usual markdown document.
ℹ You may use
<!-- toc -->
to have a table of content inserted at that place.
Install dependencies (npm i
) then use npm start --
to run the CLI
(e.g. npm start -- serve --material=./training-material
where ./training-material
points to directory with training material in it).
You may alternatively use npm run dev --
instead to enable restart on change
(e.g. npm run dev -- serve --material=./training-material
).
Note that npm run dev
requires Node.js 18.11 or later.
Tests are written using the built-in test module, which requires Node.js 18.3 or later.
npm test
npm test path/to/test/file.test.js
src/app
: source code for the web app that embeds training materialsrc/build
: source code that builds the previously mentioned web app,
including the training materialsrc/pdf
: source code that builds PDFs from the training materialsrc/cli
: source code for the CLIThis project uses Prettier. Don't forget to format before committing! You may
use npm run prettier:write
to do that.
docker pull zenika/sensei