Narutopedia
Register
(New page: {{Forumheader|Narutopedia Announcements}} <!-- Please put your content under this line. Be sure to sign your edits with four tildes ~~~~ --> For quite some time now, the template style o...)
 
m (Forum:Style Change moved to Forum:Infobox template usage style change)
 

Latest revision as of 01:00, 25 December 2008

Forums: Index Narutopedia Announcements Infobox template usage style change
Note: This topic has been unedited for 5566 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


For quite some time now, the template style on the wiki was indirectly controlled by me. Basically I had a style I worked with on all templates, I used that style when writing the example usage on the template page, and because I was also normally the first person to start using the template, and other people normally just copied that and modified it to fit.

As it is my nature as a programmer, I like to keep code as neat and tidy as the pages themselves. The primary thing of that, means keeping things standardized by what's most common. If template "GoHereDoThat" is normally used like {{GoHereDoThat}} then I don't like to go to another page and see {{ goHereDoThat }} even though the system considers them the same. So things like using the same case on all uses of the same template, using a certain pattern on how much whitespace to put in between keys ='s and |'s inside pages, not switching between ==Header== or == Header == within articles, are all bits I like to keep code neat.

I'm making this note here, cause I'm thinking of changing a bit of that style. You don't have to worry about it much, cause of course my nice and handy bots would end up cleaning it all up for everyone.

Currently, all box like templates (basically Infoboxes), have a common pattern for how they are put on a page. Something like this:

{{TemplateName
    | key         = asdlkjf
    | another key = 
}}

The key points, being one tab at the start, one space between the | and the key, and enough spaces after the key and before the = to keep all the ='s on the same line, note that for many of the infoboxes, this is actually something to do with the length of the longest key out of all the infoboxes (so that infoboxes stuck together don't look awkward by the = at different spots), and finally there is always a trailing space after the = , even if there is no value.

It's what I found what the cleanest form for the infobox templates. However I've come to notice that the indentation at the start is starting to differ between pages. The original infoboxes all used a single tab character at the start, however I've come to notice that sometimes one or two of those tabs (or even all of them) get replaced with a set of spaces. It has been my nature in programming to loath the use of spaces as the whitespace used in indentation, I've always favored the tab as a lot of programmers do.

The tab character of course, causes some issues on the internet as you cannot type it, while that is of course not an issue with infobox templates as most of the time people just do a copy and paste, when they break the style a little, people have a habit of trying to fix what they broke by putting the padding back, this of course confuses people because some of them just match up the tab with a number of spaces. And thus, this causes the skewing of the indentation.

After thinking about the space vs. the tab, I realized another thought "Why do templates even need to be indented?" Templates don't get nested, and there seams to be little reason for indentation, most likely it was just a result of my programmer's habit of indenting blocks of code. It's overall not useful in Wiki markup.

Another important factor, is that I cannot type a tab within my console (which is used when working with a bot), so I can't exactly use a tab within a replacement of stuff on the wiki very easily.

So I've decided to opt for a form of templates more like:

{{TemplateName
| key         = asdlkjf
| another key = 
}}

It makes a bit more sense, it's closer to what will actually be outputted when things like Semantic Forms are the ones actually handling infoboxes (^_^ At which point, absolutely none of you will have to worry about "Erm, I make indentation look ugly, what do I do?"), and it makes bot work easier. ~NOTASTAFF Daniel Friesen (DanTMan, Nadir Seen Fire) (talk) Dec 25, 2008 @ 01:00 (UTC)