Board Thread:Lua Help/@comment-131168-20140909104311

This script is definitely rough, inconsistent, and not quite as international as I'd like, so I wouldn't feel very comfortable adding it to the wiki proper as an example. It does a pretty good job of replacing an unwieldy pre-Lua system, though, so I thought I'd share what there is.

I saw other wikis using a "This Day in History" sort of system, which I adapted into a "Birthday" system. It would check for pages with names based on the calendar days for the upcoming week and display the contents if they existed. Of course this means that everything is split up into hundreds of different pages.

So I made Module:Birthday to replace it. Some instructions for use at the related template page since modules can't yet have /doc pages. A number of advantages:
 * All dates together. Easier for editing, easier for copying to interlanguage sister wikis. Though as coded it's a bit inefficient that it bothers to do some work with the names in two formats, this does mean it's even fairly quick to get going where kanji versions of names should be used.
 * More options. I made it so a person could specify how many days out to show birthdays, as well as a minimum number to show in case there's a dry spot where the next week is empty.
 * More tricks. Since all the data was there, it was pretty easy to add new functions like showing all the birthdays for a given month, year, arbitrary time frame, or people of a certain age.

Biggest problems:
 * Well, I'm not the cleanest coder so I'm sure it's not all very easy to follow or done in the best way. A few times I've fixed an error for one circumstance that created an error elsewhere that needed fixing, so it's compounded a bit.
 * Though I made it to be simple to copy to sister wikis and have done so in two places (Japanese, Czech), in each case there's some added or modified code to help format the output in a way appropriate to the language. So when I've made additions or fixes, it's not quite as easy as copying the whole thing and flicking one switch to choose the output style. 