add example lua stuff
This commit is contained in:
parent
a3ed5a9d91
commit
0e51b675c2
8
build.sh
8
build.sh
@ -27,9 +27,13 @@ _next=""
|
|||||||
unstable="no"
|
unstable="no"
|
||||||
neochan="no"
|
neochan="no"
|
||||||
buildredis="no"
|
buildredis="no"
|
||||||
|
lua="no"
|
||||||
# check for build flags
|
# check for build flags
|
||||||
for arg in "$@" ; do
|
for arg in "$@" ; do
|
||||||
case $arg in
|
case $arg in
|
||||||
|
"--enable-lua")
|
||||||
|
lua="yes"
|
||||||
|
;;
|
||||||
"--enable-redis")
|
"--enable-redis")
|
||||||
buildredis="yes"
|
buildredis="yes"
|
||||||
;;
|
;;
|
||||||
@ -62,6 +66,10 @@ if [ "$buildredis" == "yes" ] ; then
|
|||||||
tags="$tags -tags disable_redis"
|
tags="$tags -tags disable_redis"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$lua" == "yes" ] ; then
|
||||||
|
tags="$tags -tags lua"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$rev" == "" ] ; then
|
if [ "$rev" == "" ] ; then
|
||||||
echo "revision not specified"
|
echo "revision not specified"
|
||||||
exit 1
|
exit 1
|
||||||
|
16
contrib/lua/memeposting.lua
Normal file
16
contrib/lua/memeposting.lua
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
-- simple replacements demo
|
||||||
|
|
||||||
|
function span_text(str, class)
|
||||||
|
return string.format("<span class='%s'>%s</span>", class, str)
|
||||||
|
end
|
||||||
|
|
||||||
|
function wobble_text(str)
|
||||||
|
return span_text("wobble", str)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- generate extra markup
|
||||||
|
function memeposting(prefix, body)
|
||||||
|
body = string.gsub(body, "<(%w+)>", wobble_text)
|
||||||
|
return body
|
||||||
|
end
|
Reference in New Issue
Block a user