show website example with lowdown

This commit is contained in:
Malin Freeborn 2024-11-28 17:08:31 +01:00
parent 5a1ba18176
commit b2ea104e96
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 44 additions and 0 deletions

View File

@ -9,6 +9,14 @@ Turn a markdown file into a pdf:
lowdown -stms "$FILE".md | pdfroff -itk -mspdf > "$FILE".pdf
```
*Example:* put [this Makefile](lowdown/example.txt) in a directory, rename it `Makefile`, then do:
```bash
make example
make
```
To give the document a title, put that title in the metadata:
```bash

View File

@ -0,0 +1,36 @@
output: all
.PHONY: example
example: html/foot.html html/head.html
mkdir -p articles/
fortune > articles/fort_1.md
fortune > articles/fort_2.md
HTML = $(patsubst articles/%.md,public/%.html,$(wildcard articles/*.md))
$(HTML): public/ articles/ $(wildcard html/*)
html/head.html:
@mkdir $(@D)
echo '<head> Something about CSS probably </head>' > $@
echo '<body>' >> $@
html/foot.html: html/head.html
echo '</body>' >> $@
public/%.html : articles/%.md
cat html/head.html > $@
lowdown $< >> $@
cat html/foot.html >> $@
.PHONY: all
all : $(HTML)
articles/:
mkdir $@
public/:
mkdir $@
clean :
rm -rf public