-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
48 lines (43 loc) · 1.45 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# variables
input := "slides.md"
output := "index.html"
options := "defaults.yaml"
target := "website"
theme := "theme.css"
template := "template.html"
home_dir := env_var('HOME')
pandoc_dir := join(home_dir, ".local/share/pandoc")
release_url := "https://github.com/pandoc/lua-filters/releases/latest"
# Construct slide from markdown
build:
mkdir -p {{target}}
rsync --archive --verbose --checksum fonts {{target}}/
rsync --archive --verbose --checksum images {{target}}/
rsync --archive --verbose --checksum theme.css {{target}}/
pandoc \
--from=markdown \
--to=revealjs \
--standalone \
--slide-level=2 \
--lua-filter={{pandoc_dir}}/filters/revealjs-codeblock.lua \
--template=template.html \
--variable=width:1920 \
--variable=height:1080 \
--variable=transition:none \
--variable=highlightjs:true \
--variable=highlightjs-theme:monokai \
--variable=navigationMode:linear \
--variable="slideNumber:'c'" \
--variable="keyboard:{13: 'next', 33: 'prev', 34: 'next'}" \
--slide-level=2 \
--output={{target}}/{{output}} \
{{input}}
watch:
fswatch -0 --one-per-batch --recursive --latency 2 {{input}} {{options}} {{theme}} {{template}} justfile fonts images | xargs -0 -I {} just build
install_filters:
curl -LSs {{release_url}}/download/lua-filters.tar.gz | tar --strip-components=1 --one-top-level={{pandoc_dir}} -zvxf -
install:
asdf install
just install_filters
clean:
rm -fr website