Skip to content

Instantly share code, notes, and snippets.

@zar3bski
Created March 13, 2020 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zar3bski/90278aa966b3eb26ff73a8307bd3ecb1 to your computer and use it in GitHub Desktop.
Save zar3bski/90278aa966b3eb26ff73a8307bd3ecb1 to your computer and use it in GitHub Desktop.
build PDF documentation from README.md [gitlab]
build_doc:
stage: build
image: pandoc/latex:2.9.2
script:
- echo "---" >> headers.md
- "echo 'title: '${CI_PROJECT_TITLE} >> headers.md"
- "echo 'date: '$(date +'%m/%d/%Y') >> headers.md"
- "echo 'header-includes: |' >> headers.md"
- echo " \usepackage{fancyhdr}" >> headers.md
- echo " \pagestyle{fancy}" >> headers.md
- echo " \fancyhead[RO,RE]{${CI_PROJECT_URL}}" >> headers.md
- echo " \fancyfoot[CO,CE]{\thepage}" >> headers.md
- echo " \fancyfoot[LE,LO]{last updt:${GITLAB_USER_EMAIL}}" >> headers.md
- echo " \fancyfoot[RE,RO]{commit:${CI_COMMIT_SHORT_SHA}}" >> headers.md
- echo "---" >> headers.md
- cat headers.md
- cat README.md >> headers.md
- cat headers.md
- pandoc headers.md -f markdown+smart --variable mainfont=Roboto --variable wrap=preserve --variable lang=fr-FR --variable fontsize=11pt --variable geometry:margin=1.5cm --pdf-engine=pdflatex --toc -o ${CI_PROJECT_NAME}_doc.pdf
artifacts:
paths:
- ./${CI_PROJECT_NAME}_doc.pdf
tags:
- docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment