Created
March 13, 2020 13:52
-
-
Save zar3bski/90278aa966b3eb26ff73a8307bd3ecb1 to your computer and use it in GitHub Desktop.
build PDF documentation from README.md [gitlab]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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