1
0

switch to a mdbook-like file layout, using src/ and out/

Unlike mdbook, the out/ directory contains needed assets and is not expendable.
This commit is contained in:
Simon Michael
2023-11-27 19:10:08 -10:00
parent 1b40d16358
commit 6f67b1bc2c
18 changed files with 17 additions and 9 deletions

View File

@@ -1,18 +1,18 @@
all: html
# Generate html from all md files
# Generate html from all md files in src/, in out/
# (including README, maybe useful for local preview. $(filter-out README.md, ...) to exclude).
html: $(patsubst %.md,%.html,$(wildcard *.md quickref/*.md)) Makefile
html: $(patsubst src/%,out/%,$(patsubst %.md,%.html,$(wildcard src/*.md src/quickref/*.md))) Makefile
PANDOC=pandoc -f markdown-smart-tex_math_dollars+autolink_bare_uris
# generate html from a md file
%.html: %.md index.tmpl
$(PANDOC) --template index.tmpl $< -o $@
out/%.html: src/%.md page.tmpl
$(PANDOC) --template page.tmpl $< -o $@
# regenerate html whenever an md file changes
html-auto auto:
ls *.md quickref/*.md | entr make html
watchexec -- make html
BROWSE=open
LIVERELOADPORT=8100
@@ -25,7 +25,7 @@ LIVERELOAD=livereloadx -p $(LIVERELOADPORT) -s
html-watch watch:
make html-auto &
(sleep 1; $(BROWSE) http://localhost:$(LIVERELOADPORT)/) &
$(LIVERELOAD) .
$(LIVERELOAD) out
# regenerate syntax quick reference html from google docs html export
# (it has been manually edited, let's not do this again)