Blog »

New OborWiki feature: Lua code execution

December 31, 2017, at 06:21 PM by Obormot in Features, Updates (0 comments)

The Lua Execute recipe is now installed on OborWiki (off by default; you can enable it via the Configurator). It allows you to embed Lua code blocks in a wiki page, which are executed, and their output displayed when the page is rendered.

Here's an example:

function demo()
 print('Counting from 1 to 5...')
 for v = 1, 5 do

print('Today is '
print('Pi is '..math.pi)
print('It works! <o>') -- By default, HTML is not allowed
print('This content was generated by '.._VERSION..'.')

NOTE: If you'd like to specify an initialization script to be run prior to every Lua code block, let me know (as that is currently a config option only I can modify, since it involves editing config.php).

See the Lua Execute recipe info page for more information.

Leave a reply
Your name (required):

Your comment (required):

Enter value: Captcha