Forum:Introducing documentation and timeline templates

There are two new templates that have been added to the wiki.

The first is Template:Timeline, for use on, oddly enough, the timeline pages.

The old navigation code looks like this:

By comparison, the new template creates the following output:

When you check out the template, you'll find instructions for how to use it on year, decade and century pages. If you're editing or surfing through the timeline pages and come across the old code, please take a few seconds to replace it with the new template. :)

Which brings us to Template:Documentation, which is intended to make creating and documenting new user templates easier.


 * → Koschei: :  Life. But not as we know it.  16:56, March 26, 2010 (UTC)


 * I really like the "standardization" that the documentation template will bring. Very crisp.  Not so wild about the timeline thing, but it's better than what was there before.  I don't visit year/century pages all that often so I was surprised to discover that the previous navigation was apparently not a template at all.  So who's actually going to be doing the laborious work of putting this new temp on the hundreds of pages involved?    Czech Out   ☎ | ✍  12:50, March 27, 2010 (UTC)


 * The beautiful thing is that once all those pages are hit with the template, it'll be trivial to insert a new navigation panel if someone feels like designing it. Until then, the layout at least has the advantage of being easier to navigate visually for folks who have problems with closely grouped strings of text on screen.
 * → Koschei: :  Life. But not as we know it.  18:22, March 29, 2010 (UTC)


 * Oh, absolutely. And I applaud you for introducing a template.  The only thing I worry about is that the task gets completed.  Are you actually going to be physically putting that template on each page, or you want me to call out the bot to help you?  I played around a little with it, and haven't got quite the right regular expression going, but I'm sure it's possible. Some editors like to have a bot help them along; some really enjoy the act of physically seeing every page their template goes on.  Lemme know if you want me to wave a magic wand.   Czech Out   ☎ | ✍  21:15, March 29, 2010 (UTC)


 * In the mean time, just change 'em here and there as you see 'em. I've changed a few over here and there thus far myself. -- sulfur 21:46, March 29, 2010 (UTC)


 * Yeah I noticed your post about the bot. How would it handle (a) parsing the values (prev, next, decade, century) from the old html to the template on pre-existing pages, and (b) interpreting those values from scratch, plus adding the appropriate category tags?
 * → Koschei: :  Life. But not as we know it.  14:19, March 30, 2010 (UTC)
 * Well, my plan with the bot was merely to find every line that began with a "<" and delete it. This is the difficult bit, kinda.  I spent a few hours a few days ago looking at it, and Python, the language of the bot, doesn't seem to have a simple delete feature, but I could be wrong.  In any case, somwhere there is a solution to that; because line deletion is too obviously useful not to be possible.  So, after I solve that, the thing key then would be just put the template on every page in that category, which is a one-line command in Python.  Super easy, that part.


 * As for the prev, next, decade, century stuff, well that'll probably best be achieved by simple mathematical expressions in the template itself. So you start with using  to determine the base for your calculations.  Prev is thus -1, Next is  .  There's probably functionality on here to convert the pagename into an actual number (as opposed to a text string that PAGENAME returns).  Then you just do a li'l series of calculations to relate that number to a particular century, and relate that to a name of an article with a century number.  I haven't looked into that side, but I can't imagine it's all that difficult to completely automate — and more importantly, idiotproof — the template.  Might require the template "timeline" to be a shell template for another template that actually does all the work.  Anyway, the important thing from a functional standpoint is to strip out the HTML.  I'm still in disbelief over the HTML.  The mind-numbing boredom of literally copying that on every page quite literally staggers the imagination.   Czech Out   ☎ | ✍  15:53, March 30, 2010 (UTC)