error handling!!

This commit is contained in:
41666 2025-04-22 21:11:48 -07:00
parent a17d82f996
commit a4faf2f38c
6 changed files with 53 additions and 13 deletions

View file

@ -8,11 +8,25 @@
# maybe don't do this but its possible to reference _any file_.
defaultLayout = ./layouts/default.html;
# these are mostly for alias purposes...
# can do an [invoke(plural)(...):yay!] type thing
# one can invoke stuff inline too without doing this.
markdollPlugins = [
markdollPlugins = let
sPoNgEbOb = pkgs.buildGoModule {
name = "sPoNgEbOb";
vendorHash = null;
src = pkgs.fetchFromGitHub {
repo = "sPoNgEbOb";
owner = "yzguy";
rev = "9e4bf8e86d5fd7870000832ff571acf13b6941eb";
hash = "sha256-MWVtW9gzYmx3sOSvPh9NI4h6MotuO1ZQyzC09jpsHJI=";
};
preBuild = ''
go mod init github.com/yzguy/sPoNgEbOb
'';
} + "/bin/sPoNgEbOb";
in [
# all of these add invoke handlers like [invoke(plural)(argv1):stdin]
(mkMarkdollPlugin "plural" ./plugins/plural.sh)
((mkMarkdollPlugin "tools" ./plugins/tools.py).override { buildInputs = [ pkgs.python3 ]; })
(mkMarkdollPlugin "sPoNgEbOb" sPoNgEbOb)
];
}

View file

@ -1,6 +1,7 @@
<!DOCTYPE html public "alt layout">
<html>
<head>
<meta charset="utf-8" />
<title>%%TITLE%% | alt layout</title>
%%HEAD%%
<style>

View file

@ -1,6 +1,7 @@
<!DOCTYPE html public "default layout">
<html>
<head>
<meta charset="utf-8" />
<title>%%TITLE%% | default layout</title>
%%HEAD%%
</head>

View file

@ -3,10 +3,24 @@ title: plugin tests
---
&plural plugin
[invoke(plural)(aki):hi this one is aki]
& referenced via $PATH
noe1: [invoke(plural)(aki):hi this one is aki]
aki1: [invoke(plural)(noe):hi this one is noe]
[invoke(plural)(noe):hi this one is noe]
& referenced via ./plugins/plural.sh
aki2: [invoke(./plugins/plural.sh)(aki):hi this one is aki]
hellorld [invoke(tools)(flip):hellorld]
noe2: [invoke(./plugins/plural.sh)(noe):hi this one is noe]
dolldolldoll|llodllodllod [invoke(tools)(flip):dolldolldoll|llodllodllod]
&python plugin (flip)
hellorld
[invoke(tools)(flip):hellorld]
dolldolldoll|llodllodllod
[invoke(tools)(flip):dolldolldoll|llodllodllod]
&go plugin
fights 41666's witch
[invoke(sPoNgEbOb):fights 41666's witch]

View file

@ -1,7 +1,7 @@
#!/bin/sh
alterName=$1
message=$(<"/dev/stdin")
message=$(cat /dev/stdin)
cat << EOF
<div class="alter alter-${alterName}">