<div dir="ltr">This is only tangentially related, but I created a Lua module for the wikipedias a few years ago:<div><br></div><div><a href="https://en.wikipedia.org/wiki/Module:OSM">https://en.wikipedia.org/wiki/Module:OSM</a><br></div><div><br></div><div>It generates an Overpass Query showing all the objects related to the Wikipedia entry via wikidata tags in the OSM data.</div><div><br></div><div>Polyglot</div></div><br><div class="gmail_quote"><div dir="ltr">Op zo 29 jul. 2018 om 15:01 schreef Yuri Astrakhan <<a href="mailto:yuriastrakhan@gmail.com">yuriastrakhan@gmail.com</a>>:<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>
_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@openstreetmap.org" target="_blank">talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/talk</a><br>
</blockquote></div>