Template talk:Pattern

From LifeWiki
Jump to navigation Jump to search

I've started making various changes to the various pattern templates to make them more readable, more editable, and more maintainable (less duplication of boilerplate code means fewer places where things can go awry, and fewer chances for divergent changes).

Most of these changes are internal to the templates and shouldn't be visible on the articles using them. There's two exceptions:

  1. I've moved "generic" parameters to (near) the top of the template. What are "generic" parameters? Those that describe traits that (almost) any kind of pattern possesses; I've deemed population and bounding box ubiquitous enough to qualify. These two now appear (if they are specified) right under the fields describing the type of a pattern.
  2. I've introduced divider lines into the infoboxes; I'd previously manually used those on Template:Conduit, and decided I liked how they look. These live in their own template now, and they're used to seperate generic parameters from pattern-type-specific parameters (e.g. period for oscillators, speed for spaceships etc.), and pattern-type-specific parameters from "discovery" information.

I am, however, divided (...oh, goodness) on how these divider lines look, especially if the sections between them are fairly small. So if anyone else thinks they're ugly, please just remove them; it should be easy (well, easier) to do now without breaking the templates.

What else is new? Some new infobox-internal templates (all inspired by Template:PatternDownload) namely Template:PatternDiscovery, Template:PatternPopulationAndBoundingBox (feel free to move this if you can think of a better name), and Template:InfoboxDivider. The former two also handle the relevant categories, so the "categories" sections of the actual infobox templates are quite a lot less cluttered.

What remains to be done? A "start-pattern-infobox" template could be introduced, displaying such things as a pattern's name, image, and embedded LifeViewer, if any. (This could also slap Category:Patterns on the transcluding article.) Template:PatternDownload and Template:PatternIdentifiers haven't been touched at all yet, and could use clean-up (Template:InfoboxDivider might come in handy there as well, BTW). More generally, some templates could use new parameters, such as mcps= for Template:Methuselah. Some of the category infrastructure could likely be removed, e.g. the population-specific unit cell categories. (What was I thinking?)

This is about all I can think of for the moment. Apple Bottom (talk) 21:06, 18 February 2018 (UTC)

Pattern infobox bug.png

I think you may have caused a bug with your edits. 77topaz (talk) 01:09, 20 February 2018 (UTC)

Thanks; should be fixed. Apple Bottom (talk) 10:21, 20 February 2018 (UTC)
Yes, I can verify it is. 77topaz (talk) 06:24, 21 February 2018 (UTC)

Further maintainability tweaks

I've moved the boilerplate code starting a pattern infobox from the various infobox templates to Template:InfoboxStart, and had the infobox templates transclude that. The infobox templates should be more readable/maintainable this way, and it should be easier to create new ones -- and if you do you won't have to rely on copying a big blob of difficult-to-understand HTML/MediaWiki markup.

As a side effect, the various templates are a bit more streamlined as well. In particular:

  1. all infoboxes display a "View static image" link now;
  2. and all infoboxes have gained the ability to use LifeViewer.

If either's not desired, Template:InfoboxStart could be tweaked to take additional parameters suppressing these. (For instance, it's debatable just how useful a LifeViewer for still lifes is -- it might actually be better just displaying static images there --, though that particular infobox'ed LifeViewer isn't actually new.)

There's still some logic left in the actual pattern templates, notably the display of type-specific parameters and the handling of type-specific categories. I think that's how it should be.

What could still be done, perhaps, is moving such parameters as type, family etc. into Template:InfoboxStart, but I'll hold off on that for now. Apple Bottom (talk) 14:28, 21 February 2018 (UTC)