plugins still can't inline huh
This commit is contained in:
parent
4ee5913bd0
commit
3dd055b640
6 changed files with 22 additions and 16 deletions
|
@ -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)
|
||||
];
|
||||
}
|
|
@ -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]
|
|
@ -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
|
|
@ -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$>
|
||||
</span>
|
||||
<span class="message">
|
||||
$(<"/dev/stdin")
|
||||
${message}
|
||||
</span>
|
||||
</div>
|
||||
EOF
|
7
examples/quickstart/plugins/tools.py
Executable file
7
examples/quickstart/plugins/tools.py
Executable 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)
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue