Fix md to pdf script
This commit is contained in:
parent
090574a169
commit
d995cf69cb
2 changed files with 11 additions and 6 deletions
|
@ -17,9 +17,9 @@ install:
|
|||
script:
|
||||
# Leave detached git HEAD
|
||||
- git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
|
||||
# Create stageable file and stage it
|
||||
- cd activiteiten/2020-2021/04_hacktoberfest/
|
||||
- sh ../../../scripts/md_to_pdf.sh
|
||||
# compile every markdown in this folder to pdf
|
||||
- cd activiteiten/2020-2021/
|
||||
- sh ../../scripts/md_to_pdf.sh
|
||||
- git add -A
|
||||
# Commit (note the [skip ci] to avoid loop)
|
||||
- 'git commit -m "chore: render activities [skip ci]"'
|
||||
|
|
11
scripts/md_to_pdf.sh
Normal file → Executable file
11
scripts/md_to_pdf.sh
Normal file → Executable file
|
@ -1,8 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Converting to HTML…"
|
||||
echo "Converting to PDF…"
|
||||
|
||||
for file in *.md */*.md
|
||||
do
|
||||
echo " converting $file"
|
||||
pandoc $file -f markdown -t pdf -o (echo "../$file" | sed '$s/\.md$/.pdf/') -s --data-dir=./ --variable=file:(echo "$file" | sed '$s/\.md$/.pdf/')
|
||||
end
|
||||
output_path=$(echo "$file" | sed '$s/\.md$/.pdf/')
|
||||
echo " $output_path"
|
||||
output_name=$(echo "$file" | sed '$s/\.md$/.pdf/')
|
||||
echo " $output_name"
|
||||
pandoc "$file" -f markdown -t pdf -o "$output_path" -s --data-dir=./
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue