home: hub: minipeg

Download patch

ref: 05d7d084a82fbea4b0d4ec11029a0eda447ba70b
parent: 918db60710597e97301e5ca74423760b68ccab8e
author: Andrew Chambers <ac@acha.ninja>
date: Sun Apr 10 16:44:17 CDT 2022

Shift website to sourcehut pages.

--- a/.builds/alpine.yml
+++ b/.builds/alpine.yml
@@ -1,5 +1,11 @@
 image: alpine/latest
+packages:
+- hut
+- mandoc
+- util-linux
 tasks:
-  - build: |
-      cd minipeg
-      make check
+- upload: |
+    cd minipeg
+    make www/index.html
+    tar -C www -cvz . > ./site.tar.gz
+    hut pages publish -d $site site.tar.gz
\ No newline at end of file
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@
 CFLAGS = -g -O2 -Wall
 
 SRC = version.h tree.h compile.c tree.c peg.c
-GENSRC = minipeg.c peg-new.c peg-amalg.c
+GENSRC = minipeg.c peg-new.c peg-amalg.c www/index.html
 OBJ = compile.o tree.o peg.o
 
 all: minipeg
@@ -36,7 +36,7 @@
 	./minipeg-amalg -o $@ peg.peg
 
 www/index.html: .FORCE
-	$(SHELL) -c '(cd www ; sh ./index.html.sh)' > $@
+	sh ./www/index.html.sh > $@
 
 # Check the pregenerated peg.c matches the built peg-new.c.
 # We also check peg-amalg.c to test our amalgamation process.
--- a/www/index.html.sh
+++ b/www/index.html.sh
@@ -15,16 +15,16 @@
 </p>
 
 <ul>
-<li>Single file distribution <a href="https://github.com/andrewchambers/minipeg/releases">minipeg.c<a/></li>
-<li>Example <a href="https://raw.githubusercontent.com/andrewchambers/minipeg/upstream/examples/calc.peg">calculator</a></li>
-<li>Example <a href="https://raw.githubusercontent.com/andrewchambers/minias/master/asm.peg">x86_64 assembler</a></li>
-<li><a href="https://github.com/andrewchambers/minipeg">Source code</a></li>
+<li>Single file distribution <a href="ach.srht.site/minipeg/minipeg.c">minipeg.c<a/></li>
+<li>Example <a href="https://git.sr.ht/~ach/minipeg/blob/upstream/examples/calc.peg">calculator</a></li>
+<li>Example <a href="https://git.sr.ht/~ach/minias/blob/master/asm.peg">x86_64 assembler</a></li>
+<li><a href="https://git.sr.ht/~ach/minipeg">Source code</a></li>
 </ul>
 
 <h2>Man Page</h2>
 EOF
 echo "<pre>"
-mandoc -Tascii -Ofragment ./minipeg.1 | col -b
+mandoc -Tascii minipeg.1 | col -b
 echo "</pre>"
 cat <<EOF
 </div>