diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2d7468..1d4455d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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]"' diff --git a/scripts/md_to_pdf.sh b/scripts/md_to_pdf.sh old mode 100644 new mode 100755 index 6931596..0fb0549 --- a/scripts/md_to_pdf.sh +++ b/scripts/md_to_pdf.sh @@ -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 \ No newline at end of file + 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