Board Thread:Lua Help/@comment-24473195-20150527141750/@comment-166269-20150527193708

I don't see how that would be the problem; Wikipedia's documentation template is just a very fancy wrapper around transcluded /doc subpages. There are a few examples of centralized documentation (e.g. the hatnote templates), or documentation that's not on a /doc subpage (though I don't know any off-hand and therefore can't speak to the reasoning behind that, though I can't see any arguments for it myself), but both of these are relatively simple to handle and I added the functionality for them to the Templates Wiki documentation system quite a while back. If I'm misunderstanding what you're getting at, though, please let me know. =)

The problem is one of performance and overhead: for a very simple function, it costs far more to set up the Lua environment and do all the other background work necessary to actually run the module than you save by doing it in Lua instead of with parser functions. This may not be a very big deal for a template that's only called once or twice a page, but this overhead must be repeated on each separate template transclusion or module invocation, meaning it can add up very quickly for templates that are used many times a page.

You'll have to explain yourself a bit more clearly here; if I understand what you're saying correctly, you claim that checking if a page exists (via ) doesn't add it to the wanted pages reports, but this isn't correct. counts as a page link, and therefore has all the same effects server-side that an ordinary page link does. And there is no other way to check a page's existence from within a template.