Build & CMake Integration
Slope is designed to be easily integrated on top of any cmake project in order to merge scientific code and your presentations!
Dependencies
- the same as Polyscope
- Imagick (
convertcommand) : Make sure that the convert command is allowed to convert pdf to png, see here. pdflatexffmpegandffprobe, optional, only for the Video and Webcam primitives.
Paths to Imagick, pdflatex and ffmpeg are found by cmake.
On a Debian or Ubuntu machine, ffmpeg provides both tools and
imagemagick provides convert:
Code syntax highlighting
Code is highlighted by tree-sitter, which cmake fetches like the other dependencies. It produces one grammar per language, compiled once (takes roughly 1 minute)
python, glsl, cpp and yaml are built by default. SLOPE_LANGUAGES trims that list, down
to nothing (code is then drawn as plain text), and SLOPE_EXTRA_LANGUAGES adds any
grammar repository carrying a src/parser.c and a queries/highlights.scm, as
name|repo|tag|extensions:
set(SLOPE_LANGUAGES python glsl CACHE STRING "")
set(SLOPE_EXTRA_LANGUAGES "rust|tree-sitter/tree-sitter-rust|v0.23.2|rs" CACHE STRING "")
Both are cache variables. Set them before the first configure, or pass
cmake -DSLOPE_LANGUAGES="python;glsl" . to a build directory that already exists. The
highlight queries are installed alongside the library, under share/slope/queries.