diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/.gitignore | 5 | ||||
| -rw-r--r-- | docs/gen/doc.m4 | 48 | ||||
| -rw-r--r-- | docs/gen/style.css | 109 | ||||
| -rw-r--r-- | docs/makefile | 32 | ||||
| -rw-r--r-- | docs/readme.md | 5 | 
5 files changed, 199 insertions, 0 deletions
| diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..14ffb91 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,5 @@ +*.html +*.toc +*.con +*.pdf +gen/paged.polyfill.js diff --git a/docs/gen/doc.m4 b/docs/gen/doc.m4 new file mode 100644 index 0000000..5719b54 --- /dev/null +++ b/docs/gen/doc.m4 @@ -0,0 +1,48 @@ +define(`docname', +	ifelse(NAME, `pva', `Plan van aanpak', +	       NAME, `pve', `Pakket van eisen', +	       NAME, `research', `Research document', +	       NAME, `design', `Design document', +				 `UNKNOWN???'))dnl + +<!DOCTYPE html> +<html lang="en-US"> +<link> +	<meta charset="utf-8"> +	<style>undivert(`style.css')</style> +	<script>undivert(`paged.polyfill.js')</script> +	`<script defer> +	window.onload = function() { +		document.querySelectorAll("nav li").forEach(item => { +			var heading = ""; +			var parent = item; +			for (parent = item; parent.nodeName != "NAV"; parent = parent.parentNode) { +				if (parent.nodeName != "LI") continue; +				heading = parent.getAttribute("data-item-num") + "." + heading; +			} + +			item.setAttribute("heading-num-fix", heading.substr(0, heading.length - 1)); +		}); +	} +	</script>' +</head> +<body> +	<div class="docintro"> +		<span class="left"> +			docname()<br/> +			Project Domotica<br/> +			esyscmd(`LANG="en_US.utf8" date "+%B %d, %Y"') +		</span> +		<span class="right"> +			Bjorn Martens <b>(???)</b><br/> +			Frenk van de Nieuwegiessen <b>(???)</b><br/> +			Joshua Regnier <b>(2183008)</b><br/> +			Loek Le Blansch <b>(2180996)</b><br/> +			Niels Stunnebrink <b>(2184532)</b> +		</span> +	</div> +	<h1>Table of contents</h1> +	undivert(NAME`.toc') +	undivert(NAME`.con') +</body> +</html> diff --git a/docs/gen/style.css b/docs/gen/style.css new file mode 100644 index 0000000..7179ded --- /dev/null +++ b/docs/gen/style.css @@ -0,0 +1,109 @@ +@media print { +	@page { +		size: A4; +		margin: 1in; + +		@bottom-center { +			content: counter(page); +		} +	} + +	html, body { +		width: 100%; +		margin: 0; +		padding: 0; +		overflow: visible; + +		font-family: "TeX Gyre Schola"; +		font-size: 11pt; +	} + +	a { +		text-decoration: none; +		color: unset; +		font-style: italic; +	} + +	pre, code { +		font-family: "JetBrainsMono Nerd Font"; +		font-size: 9pt; +	} + +	figure { +		text-align: center; +	} + +	figcaption, p { +		text-align: justify; +		text-justify: auto; +		hyphens: auto; +	} + +	figcaption { +		display: inline-block; +		counter-increment: fig; +	} + +	figcaption::before { +		content: "Figure " counter(fig) ": "; +	} + +	table { +		border-collapse: collapse; +		border-style: solid; +		border-width: 0.7pt 0; +		border-color: black; +		margin: 1rem auto; +	} + +	th, td { +		padding: 2pt 6pt; +	} + +	th { +		border-bottom: 1pt solid black; +	} + +	.docintro { +		display: flex; +		flex-direction: row; +		justify-content: space-between; +		margin: 0; +	} + +	.docintro .left, +	.docintro .right { +		display: block; +	} + +	.docintro .right { +		text-align: right; +	} + +	.pagebr { +		break-before: page; +	} + +	nav ol { +		counter-reset: item; +		list-style-type: none; +	} + +	nav li { +		position: relative; +		counter-increment: item; +	} + +	nav li::before { +		position: absolute; +		transform: translateX(-100%) translateX(-5pt); +		left: 0; +		content: attr(heading-num-fix); +	} + +	img { +		max-width: 13cm; +		display: block; +		margin: 0 auto; +	} +} diff --git a/docs/makefile b/docs/makefile new file mode 100644 index 0000000..e4fcb15 --- /dev/null +++ b/docs/makefile @@ -0,0 +1,32 @@ +PANDOC = pandoc +M4 = m4 +RM = rm -f +CHROME = chromium --headless --run-all-compositor-stages-before-draw --virtual-time-budget=10000 --print-to-pdf-no-header +CURL = curl +PUP = pup + +SRCS = $(wildcard *.md) +HTML_T = $(SRCS:.md=.html) +PDF_T = $(SRCS:.md=.pdf) + +.PRECIOUS: %.toc %.con + +all: $(HTML_T) + +gen/paged.polyfill.js: +	$(CURL) -Ls https://unpkg.com/pagedjs/dist/paged.polyfill.js > $@ + +%.con: %.md +	$(PANDOC) $< --to=html > $@ + +%.toc: %.md +	$(PANDOC) $< -s --toc --to=html 2> /dev/null | $(PUP) '#TOC' | sed -r 's/<(.?)ul>/<\1ol>/g' > $@ + +%.html: %.con %.toc gen/doc.m4 gen/paged.polyfill.js gen/style.css +	$(M4) -Igen -DNAME=$(basename $<) gen/doc.m4 > $@ + +%.pdf: %.html +	$(CHROME) --print-to-pdf=$@ $< 2> /dev/null + +clean: +	$(RM) $(HTML_T) $(PDF_T) *.toc *.con gen/paged.polyfill.js diff --git a/docs/readme.md b/docs/readme.md new file mode 100644 index 0000000..720672c --- /dev/null +++ b/docs/readme.md @@ -0,0 +1,5 @@ +# docs + +this folder contains project documentation in markdown format. these documents +can be compiled to html using the makefile in this folder. + |