10
2
Fork 0

extremely basic html output styling

This commit is contained in:
xenia 2020-06-03 20:53:43 -04:00
parent 9f060902e3
commit c5c412ce78
3 changed files with 37 additions and 7 deletions

View File

@ -1,11 +1,14 @@
.PHONY: all clean genreadme
.PHONY: all clean
# i know this makefile is mega cursed i'm sorry :<
# ~ 🦈
CATS=aaaa comms ground-segment payload satellite-bus space
DOCS_ALL=$(wildcard $(addsuffix /**/README.md,$(CATS)))
WRITEUP_PDF=writeup.pdf
PDF_DIR=build
HTML_DIR=html
HTML_CONTENT_ALL=$(addprefix $(HTML_DIR)/,$(wildcard $(addsuffix /**/*,$(CATS))))
HTML_CONTENT_ALL=$(addprefix $(HTML_DIR)/,jork.png blahaj.css $(wildcard $(addsuffix /**/*,$(CATS))))
HTML_DOCS=$(addprefix $(HTML_DIR)/,$(DOCS_ALL:README.md=index.html))
HTML_INDEX=$(HTML_DIR)/index.html
HTML_TEMPLATE=$(abspath default.html5)
@ -33,10 +36,20 @@ $(WRITEUP_PDF): $(DOCS_ALL) fonts.tex misc.tex top.md
-i writeup.md --pdf-engine=lualatex -o writeup.pdf
@cp $(PDF_DIR)/writeup.pdf $@
$(HTML_INDEX): $(HTML_CONTENT_ALL) $(HTML_DOCS) README.md
@echo "GEN $@"
$(HTML_INDEX): $(HTML_DIR)/index.md $(HTML_DIR)/jork.png $(HTML_DIR)/blahaj.css
@echo "HTML $@"
@cp -r mathjax/ $(HTML_DIR)/mathjax/
@pandoc -i README.md -o $@
@pandoc -i $< -o $@ -t html5 -s --template $(HTML_TEMPLATE) --metadata lang=en \
--metadata title="BLAHAJ Hack-a-Sat 2020 Writeups" \
--metadata css="blahaj.css"
$(HTML_DIR)/index.md: $(HTML_CONTENT_ALL) $(HTML_DOCS)
@echo "GEN $@"
@(printf "![A picture of a jork (jean shork)](jork.png)\n\n"; \
printf "# BLAHAJ Hack-a-Sat 2020 Writeups\n\n"; \
for file in $(DOCS_ALL); do \
printf -- "- [%s](%s/index.html)\n" "$$(grep '^# ' $$file|head -n1)" "$$(dirname $$file)"; \
done) > $@
$(HTML_CONTENT_ALL): $(HTML_DIR)/%: %
@mkdir -p $(dir $@) || true
@ -45,6 +58,7 @@ $(HTML_CONTENT_ALL): $(HTML_DIR)/%: %
$(HTML_DOCS): %index.html: %README.md
@echo "HTML $@"
@cd $(dir $@) && \
pandoc --filter pandoc-include-code --toc --toc-depth 2 -f markdown \
pandoc --filter pandoc-include-code --toc -f markdown \
-i README.md -t html5 -o index.html --mathjax="../../mathjax/tex-mml-chtml.js" \
-s --metadata title="$$(grep '^# ' README.md)" --template $(HTML_TEMPLATE)
-s --metadata title="$$(grep '^# ' README.md|head -n1)" --template $(HTML_TEMPLATE) \
--metadata lang=en --metadata css="../../blahaj.css"

14
blahaj.css Normal file
View File

@ -0,0 +1,14 @@
html, body {
margin: 0;
padding: 0;
}
main {
max-width: 1000px;
margin-left: auto;
margin-right: auto;
}
img {
max-width: 100%;
}

View File

@ -39,9 +39,11 @@ $endif$
$table-of-contents$
</nav>
$endif$
<main>
$body$
$for(include-after)$
$include-after$
$endfor$
</main>
</body>
</html>