<div dir="ltr">P.S. If you want to test this new functionality, please use Module:sandbox/your_wiki_user_name pages (or a subpage of that, e.g. <span style="font-size:small;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Module:sandbox/your_wiki_user_name/my_test_1). Once the template is ready for usage, you can always rename it to something else.</span></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 29, 2018 at 2:57 PM Yuri Astrakhan <<a href="mailto:yuriastrakhan@gmail.com">yuriastrakhan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone. Thanks to Tom Hughes, we now have Scribunto extension set up on OSM wiki, which allows Lua language in addition to the very slow and unreadable wiki template language.<div><br></div><div>Documentation:</div><div>* <a href="https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual" target="_blank">https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual</a><br></div><div>* <a href="https://en.wikipedia.org/wiki/Wikipedia:Lua" target="_blank">https://en.wikipedia.org/wiki/Wikipedia:Lua</a></div><div><br></div><div>Benefits:</div><div>* Much better performance compared with wiki template language</div><div>* Substantially more readable</div><div>* Allows greater flexibility with how templates are set up</div><div><br></div><div>Migration:</div><div>The usual migration is to re-implement complex and often-used templates in Lua (as a Module:* pages), and keep the existing template as a "wrapper" - a one-liner with {{#invoke:mymodulepage|mymodulefunction}}. This way existing pages do not need to be changed, but get all the performance benefits.</div><div><br></div><div>Template info:</div><div>Create a "doc" sub-page, e.g. Module:<my_module>/doc and put all the documentation there.</div><div><br></div><div>Testing:</div><div>I would advise to create "unit tests" for the complex templates. The simplest way is to create a Module:<my_module_page>/doc page with a table of all possible usages of the module, There is also a good practice page</div><div><a href="https://en.wikipedia.org/wiki/Wikipedia:Lua#Unit_testing" target="_blank">https://en.wikipedia.org/wiki/Wikipedia:Lua#Unit_testing</a></div><div><br></div><div>Once again, thanks Tom for helping with this!</div></div>
</blockquote></div>