From 7dd019030560ad38fe4b93954a3a359ac5e43613 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 12 Apr 2024 15:08:14 +0200 Subject: generate bad looking pdfs w/ makefile --- docs/.gitignore | 1 + docs/font.mk | 36 ++++++++++++++++++++++++++++++ docs/makefile | 13 +++++++++-- docs/plan.adoc | 5 +---- docs/share/meta.adoc | 11 +++++----- docs/theme.yml | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 116 insertions(+), 12 deletions(-) create mode 100644 docs/font.mk create mode 100644 docs/theme.yml diff --git a/docs/.gitignore b/docs/.gitignore index a136337..397e45c 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ *.pdf +res diff --git a/docs/font.mk b/docs/font.mk new file mode 100644 index 0000000..8646e0f --- /dev/null +++ b/docs/font.mk @@ -0,0 +1,36 @@ +TEX_GYRE_SCHOLA += res/font/texgyreschola-bold.otf +TEX_GYRE_SCHOLA += res/font/texgyreschola-bolditalic.otf +TEX_GYRE_SCHOLA += res/font/texgyreschola-italic.otf +TEX_GYRE_SCHOLA += res/font/texgyreschola-regular.otf +$(TEX_GYRE_SCHOLA) &: + mkdir -p res/font + curl -sLo- 'https://www.gust.org.pl/projects/e-foundry/tex-gyre/schola/qcs2.005otf.zip' > texgyreschola.zip + unzip -oq texgyreschola.zip -d res/font + rm texgyreschola.zip + +JETBRAINS_MONO += res/font/JetBrainsMono-Bold.ttf +JETBRAINS_MONO += res/font/JetBrainsMono-BoldItalic.ttf +JETBRAINS_MONO += res/font/JetBrainsMono-Italic.ttf +JETBRAINS_MONO += res/font/JetBrainsMono-Regular.ttf +$(JETBRAINS_MONO) &: + mkdir -p res/font + curl -sLo- 'https://download-cdn.jetbrains.com/fonts/JetBrainsMono-2.304.zip' > jetbrainsmono.zip + unzip -oqj jetbrainsmono.zip -x 'fonts/webfonts/*' 'fonts/variable/*' '*/JetBrainsMonoNL-*' 'AUTHORS.txt' 'OFL.txt' -d res/font + rm jetbrainsmono.zip + +INTER += res/font/Inter-Bold.otf +INTER += res/font/Inter-BoldItalic.otf +INTER += res/font/Inter-Italic.otf +INTER += res/font/Inter-Regular.otf +$(INTER) &: + mkdir -p res/font + curl -sLo- 'https://github.com/rsms/inter/releases/download/v4.0/Inter-4.0.zip' > inter.zip + unzip -oqj inter.zip -x 'web/*' 'extras/ttf/*' '*.ttc' '*Variable*.ttf' '*/InterDisplay-*' 'LICENSE.txt' 'help.txt' -d res/font + rm inter.zip + +SANS_SERIF_FONTS := $(INTER) +SERIF_FONTS := $(TEX_GYRE_SCHOLA) +MONOSPACE_FONTS := $(JETBRAINS_MONO) + +ALL_FONTS := $(SANS_SERIF_FONTS) $(SERIF_FONTS) $(MONOSPACE_FONTS) + diff --git a/docs/makefile b/docs/makefile index 4c1d21a..385ed09 100644 --- a/docs/makefile +++ b/docs/makefile @@ -1,4 +1,13 @@ all: plan.pdf -%.pdf: %.adoc - asciidoctor -r asciidoctor-pdf -b pdf $< +include font.mk + +# PDFDEPS += $(ALL_FONTS) +PDFDEPS += ./theme.yml + +ASCIIDOCTOR_ARGS += --backend pdf +ASCIIDOCTOR_ARGS += --attribute pdf-theme=./theme.yml +# ASCIIDOCTOR_ARGS += --attribute pdf-fontsdir=./res/font +%.pdf: %.adoc $(PDFDEPS) + asciidoctor --require asciidoctor-pdf $(ASCIIDOCTOR_ARGS) $< + diff --git a/docs/plan.adoc b/docs/plan.adoc index 70db19d..b69c7bc 100644 --- a/docs/plan.adoc +++ b/docs/plan.adoc @@ -1,9 +1,6 @@ -= Puzzle Box Project Plan += Project Plan: Project Puzzlebox include::share/meta.adoc[] -== Table of Contents -:toc: - == Introduction This document has been written by students following the computer science diff --git a/docs/share/meta.adoc b/docs/share/meta.adoc index 1df62fe..ad99228 100644 --- a/docs/share/meta.adoc +++ b/docs/share/meta.adoc @@ -1,9 +1,8 @@ +:sectnums: +:title-page: +:toc: +:toclevels: 4 +:pagenums: Thomas in ‘t Anker; Loek Le Blansch; Lars Faase; Elwin Hammer 0.0, 2024-04-01 -:doctype: book - -[.metadata] -{authors} -- version {revnumber}, {revdate} - - diff --git a/docs/theme.yml b/docs/theme.yml new file mode 100644 index 0000000..0ca5d6b --- /dev/null +++ b/docs/theme.yml @@ -0,0 +1,62 @@ +# extends: default + +page: + size: a4 + margin: [1in, 1in, 1in, 1in] + numbering: + start-at: toc + +base: + hyphens: true + text-align: justify + +prose: + margin-bottom: 3mm + +# font: +# catalog: +# serif: +# bold: texgyreschola-bold.otf +# bold_italic: texgyreschola-bolditalic.otf +# italic: texgyreschola-italic.otf +# normal: texgyreschola-regular.otf +# sans_serif: +# bold: Inter-Bold.otf +# bold_italic: Inter-BoldItalic.otf +# italic: Inter-Italic.otf +# normal: Inter-Regular.otf +# monospace: +# bold: JetBrainsMono-Bold.ttf +# bold_italic: JetBrainsMono-BoldItalic.ttf +# italic: JetBrainsMono-Italic.ttf +# normal: JetBrainsMono-Regular.ttf + +base: + # font-family: serif + font-size: 10.5 + +title-page: + align: center + title: + margin-top: 1cm + font-size: 18 + font-style: bold + subtitle: + margin-bottom: 1cm + font-size: 16 + authors: + margin-bottom: 1cm + +heading: + align: left + margin-top: 15pt + margin-bottom: 5pt + font-style: bold + h2-font-size: $base-font-size * 1.7 + h3-font-size: $base-font-size * 1.4 + h4-font-size: $base-font-size * 1.2 + h5-font-size: $base-font-size + +toc: + indent: 5mm + line-height: 1.4 -- cgit v1.2.3