Files
slide_example/scripts/slides_to_html.sh

19 lines
748 B
Bash
Raw Normal View History

2024-04-21 18:55:28 +02:00
#! /usr/bin/env bash
HIGHLIGHT_STYLE=tango
SLIDE_LEVEL=2
my_header=$(<./templates/html_header.md)
headEscapedForSed=${my_header//$'\n'/\\$'\n'}
2024-08-03 19:12:42 +02:00
for filename in $*
do
echo compiling $filename
file_out=`echo $filename | sed -e 's/\.md/\.html/g'`
2025-09-24 19:19:26 +02:00
sed -e "s|SLIDEHEAD|$headEscapedForSed|g" $filename | pandoc -s --mathjax="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS_HTML" -t revealjs -o html/$file_out --slide-level=$SLIDE_LEVEL --highlight-style=$HIGHLIGHT_STYLE -V revealjs-url=https://unpkg.com/reveal.js@5.2.0 --template=./templates/template.revealjs --css=./custom.css --toc --toc-depth=1
2025-03-30 20:13:12 +02:00
if [ -f ./templates/custom.css ]; then
2025-09-24 19:05:12 +02:00
cp -n ./templates/custom.css ./html/custom.css
2025-03-30 20:13:12 +02:00
fi
2024-08-03 19:12:42 +02:00
echo output $file_out
done