summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2021-10-15 15:50:52 -0600
committerAaron Ball <nullspoon@oper.io>2021-10-15 15:50:52 -0600
commit0ecef7b6674d67020a24eaf8d434b69f1bbf6220 (patch)
tree6948b4ccb1ef85d75c06c755bda8d1eca38ecef0
parent0426e7add8a19003bb37d1788d5f4e0488ac3481 (diff)
downloadoper.io-0ecef7b6674d67020a24eaf8d434b69f1bbf6220.tar.gz
oper.io-0ecef7b6674d67020a24eaf8d434b69f1bbf6220.tar.xz
Add markdown (commonmark) support
-rw-r--r--Makefile5
-rwxr-xr-xhooks/post-receive4
2 files changed, 9 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index dada480..39fe7cb 100644
--- a/Makefile
+++ b/Makefile
@@ -27,6 +27,11 @@ rst: validate
printf '<div class="paragraph datelastedit"><p>Last edited: %s</p></div>\n' \
"$(shell date '+%F %T %Z')" >> "$(DEST)"
+md: validate
+ cmark --to html "$(SRC)" > "$(DEST)"
+ printf '<div class="paragraph datelastedit"><p>Last edited: %s</p></div>\n' \
+ "$(shell date '+%F %T %Z')" >> "$(DEST)"
+
src:
if [ ! -d obj ]; then mkdir obj; fi
cc $(CCOPTS) src/common.c -c -o obj/common.o
diff --git a/hooks/post-receive b/hooks/post-receive
index 78c0bd4..6269af4 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -15,6 +15,10 @@ for i in ${FILES_E[*]} ${FILES_A[*]} ${FILES_M[*]}; do
dest="${_web}/html/$(basename ${i%.*}).html"
make rst SRC="${i}" DEST="${dest}"
+ elif [ "${i##*.}" = 'md' ]; then
+ dest="${_web}/html/$(basename ${i%.*}).html"
+ make md SRC="${i}" DEST="${dest}"
+
elif [ "$(dirname ${i})" = 'src' ]; then
recompile=1

Generated by cgit