plugin support
This commit is contained in:
parent
317dd961a2
commit
4ee5913bd0
7 changed files with 58 additions and 12 deletions
14
examples/plugins/plural.sh
Executable file
14
examples/plugins/plural.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
alterName=$1
|
||||
|
||||
cat << EOF
|
||||
<div class="alter alter-${alterName}">
|
||||
<span class="alter-name">
|
||||
${alterName}@41666$>
|
||||
</span>
|
||||
<span class="message">
|
||||
$(<"/dev/stdin")
|
||||
</span>
|
||||
</div>
|
||||
EOF
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, brewTea, ... }: brewTea {
|
||||
{ pkgs, brewTea, mkMarkdollPlugin }: brewTea {
|
||||
name = "examples_quickstart";
|
||||
version = "0.0.0";
|
||||
|
||||
|
@ -7,4 +7,11 @@
|
|||
|
||||
# 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 = [
|
||||
(mkMarkdollPlugin "plural" ../plugins/plural.sh)
|
||||
];
|
||||
}
|
7
examples/quickstart/pluginTests.doll
Normal file
7
examples/quickstart/pluginTests.doll
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: plugin tests
|
||||
---
|
||||
|
||||
&plural plugin
|
||||
[invoke(plural)(aki):hi this one is aki]
|
||||
[invoke(plural)(noe):hi this one is noe]
|
13
examples/quickstart/plugins/inline-example.sh
Executable file
13
examples/quickstart/plugins/inline-example.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
|
||||
flip() {
|
||||
LC_ALL=C LC_ALL=en_US.UTF-8 rev <"/dev/stdin"
|
||||
}
|
||||
|
||||
main() {
|
||||
case $1 in
|
||||
flip) flip;;
|
||||
esac
|
||||
}
|
||||
|
||||
main $1
|
Loading…
Add table
Add a link
Reference in a new issue