On my wiki, as is certainly the case in multiple wikis, certain information is repeated across multiple pages, namely stuff like event dates and birth years. The data should be the same each time, but often there are inconsistencies, and a lot of that has to do with ambiguities in the source material. A system was put in place to deal with these ambiguities, but naturally few users are really aware of it, and even fewer I think still fully understand / agree with it (there has to be some kind of compromise no matter what).
Anyway, we have a timeline that has this information, and I had the idea to reorganize it in a form that would be easier to parse with a Lua module, namely a wikitable. Unfortunately, the wikitable is still proving very difficult to parse or convert pieces of it into new wikitables. I'm unable to get any useful error information, and I don't know how to use the console. I haven't been able to find any existing solutions to what I need. But somehow I've been able to figure something out, and I'm now able to extract a portion of a wikitable and return a new wikitable.
Now I've been trying to split wikitables into pieces. Running the partial table function over and over is very inefficient for this purpose.
In this diff, the left revision works for 1 split = 3 arguments. The right revision is supposed to work for m splits = 2m + 1 arguments, i.e. n arguments = n / 2 splits rounded down. However, it does nothing to the wikitable. I've tried various other ways of doing this, and all of them either do nothing or output a "script error". I've hard-coded the for loop limit for 2 splits = 5 arguments, and that works as intended.
I don't know if it's something I'm missing or some limitation I'm not aware of. If there's an easier way to do all of this instead of struggling to reinvent the wheel, that would be great also. I've considered on multiple occasions not using wikitables at all for this purpose and trying to use some simpler format like csv or something, but I'm not really sure how I'd go about implementing that, or if that would impede editing accessibility.