Search code examples
mediawikiwikiwikitextscribunto

How to run Lua code directly inline with Scribunto


I have a very short piece of lua code (example: os.date("%Z") ). I want to know if it is possible (currently or planned) to invoke that code directly on the same page, rather than creating a module with only one function, which job is to call that code.

I know creating a module with other time functions would be approach, but no wiki user will need to use others functions in the future. So creating I don't think it worth creating a library(module) of that kind.


Solution

  • No, that's not possible, currently or planned. You must create a module with one function, and invoke it.

    Note that this code snippet is an obviously reusable function, which one might call "getDefaultTimezone".