plugins still can't inline huh

This commit is contained in:
41666 2025-04-22 12:04:25 -07:00
parent 4ee5913bd0
commit 3dd055b640
6 changed files with 22 additions and 16 deletions

View file

@ -12,6 +12,7 @@
# can do an [invoke(plural)(...):yay!] type thing
# one can invoke stuff inline too without doing this.
markdollPlugins = [
(mkMarkdollPlugin "plural" ../plugins/plural.sh)
(mkMarkdollPlugin "plural" ./plugins/plural.sh)
(mkMarkdollPlugin "tools" ./plugins/tools.py)
];
}

View file

@ -4,4 +4,9 @@ title: plugin tests
&plural plugin
[invoke(plural)(aki):hi this one is aki]
[invoke(plural)(noe):hi this one is noe]
[invoke(plural)(noe):hi this one is noe]
hellorld [invoke(tools)(flip):hellorld]
dolldolldoll|llodllodllod [invoke(tools)(flip):dolldolldoll|llodllodllod]

View file

@ -1,13 +0,0 @@
#!/bin/sh
flip() {
LC_ALL=C LC_ALL=en_US.UTF-8 rev <"/dev/stdin"
}
main() {
case $1 in
flip) flip;;
esac
}
main $1

View file

@ -1,6 +1,7 @@
#!/bin/sh
alterName=$1
message=$(<"/dev/stdin")
cat << EOF
<div class="alter alter-${alterName}">
@ -8,7 +9,7 @@ cat << EOF
${alterName}@41666$>&nbsp;
</span>
<span class="message">
$(<"/dev/stdin")
${message}
</span>
</div>
EOF

View file

@ -0,0 +1,7 @@
#!/usr/bin/env python3
import sys
if sys.argv[1] == "flip":
stdin = sys.stdin.read()
print(stdin[::-1], flush=True)

View file

@ -2,6 +2,11 @@
inherit name src;
version = "0.0.0";
dontUnpack = true;
buildInputs = [
pkgs.python3
];
installPhase = "
mkdir -p $out/bin
cp $src $out/bin/${name}