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
|
# can do an [invoke(plural)(...):yay!] type thing
|
||||||
# one can invoke stuff inline too without doing this.
|
# one can invoke stuff inline too without doing this.
|
||||||
markdollPlugins = [
|
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
|
&plural plugin
|
||||||
[invoke(plural)(aki):hi this one is aki]
|
[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
|
#!/bin/sh
|
||||||
|
|
||||||
alterName=$1
|
alterName=$1
|
||||||
|
message=$(<"/dev/stdin")
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
<div class="alter alter-${alterName}">
|
<div class="alter alter-${alterName}">
|
||||||
|
@ -8,7 +9,7 @@ cat << EOF
|
||||||
${alterName}@41666$>
|
${alterName}@41666$>
|
||||||
</span>
|
</span>
|
||||||
<span class="message">
|
<span class="message">
|
||||||
$(<"/dev/stdin")
|
${message}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
EOF
|
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;
|
inherit name src;
|
||||||
version = "0.0.0";
|
version = "0.0.0";
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.python3
|
||||||
|
];
|
||||||
|
|
||||||
installPhase = "
|
installPhase = "
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp $src $out/bin/${name}
|
cp $src $out/bin/${name}
|
||||||
|
|
Loading…
Add table
Reference in a new issue