-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (22 loc) · 1 KB
/
Makefile
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
build:
bash contrib/build-pdf.sh
test:
docker run --rm \
--volume "$$(pwd):/data" \
--user $$(id -u):$$(id -g) \
pandoc/extra contrib/example.md -o contrib/example.pdf --template eisvogel --listings
#!/bin/bash
# Trova tutti i file .md nella cartella archive e li converte in PDF
find archive -name "*.md" | while read -r file; do
# Esegui il container Docker con pandoc per ogni file trovato
pdf=$(dirname "$file")/$(basename "$file" .md).pdf
html=$(dirname "$file")/$(basename "$file" .md).html
echo $file $pdf
docker run --rm \
--volume "$(pwd):/data" \
--user "$(id -u):$(id -g)" \
pandoc/extra "$file" -o "$pdf" \
--template eisvogel --listings
pandoc $file -o $html
echo "Convertito: $file in $(dirname "$file")/$(basename "$file" .md).pdf"
done