I'm testing a template [:it:s:Template:Pg]] (calling a Lua module) that fastly converts book page numbers, passed as the unique parameter to the template,  into links to right djvu pages, without any need to add delta parameters and linking any format for page number (arabic, roman, other...) since page numbers are seen as strings. 

The Lua script reads a data page, containing tables for conversion book page->djvu page and reverse, using mw.loadData() function for max efficiency (often there are dozens, sometimes hundreds of links to pages into a single book page; ity happens into analytical indexes, glossaries and so on).

The Lua data page is written in a eyeblink by a js script, which reads and parses html of Index: page, produced by pagelist tag; so it's very comfortable to fill such data page and to update it, if pagelist parameters are updated. 

Is this "beginner's Lua exercise" someway interesting/inspiring  in your opinion? 

Alex brollo