Dominion Strategy Forum

Meta => Feedback => Dominion Strategy Wiki Feedback => Topic started by: TwiNight on November 08, 2012, 12:57:54 am

Title: Templates and documentations
Post by: TwiNight on November 08, 2012, 12:57:54 am
IMO, Templates is the best part of MediaWikis. It allow one to rapidly create content and standardize format. (And I am obsessed with standardization)
Over the several years I was active in Wikipedia, I spend considerable time studying and creating templates.
I am no expert, but I am willing to put my knowledge into the wiki.

Here are a list of templates I created or substantially modified and added features to. Use these templates to your convenience as you see fit.

Kingdom
Kingdom/potion
Kingdom/looter
Card2cost
Card2set
Cost
Icon
Navbox
Infobox
Infobox Card
Infobox 2CardCombo
Infobox Set
Infobox Website
Reflist

btw, My User page (http://wiki.dominionstrategy.com/index.php/User:TwiNight) has information about some current projects. Look for Occupied sandboxes (because content in Available ones is most likely finished and/or published) and the testcases sandbox
Title: Re: Templates and documentations
Post by: Qvist on November 08, 2012, 02:08:31 am
IMO, Templates is the best part of MediaWikis. It allow one to rapidly create content and standardize format. (And I am obsessed with standardization)
Over the several years I was active in Wikipedia, I spend considerable time studying and creating templates.
I am no expert, but I am willing to put my knowledge into the wiki.

Here are a list of templates I created or substantially modified and added features to. Use these templates to your convenience as you see fit.

Kingdom
Kingdom/potion
Card2cost
Cost
Navbox
Very cool. I appreciate.
Title: Re: Templates and documentations
Post by: DStu on November 08, 2012, 02:34:05 am
Cost

So how do we keep it with the {{Coin}} and {{P}} template then? I see that you used them in your template, but do we want to keep them on the pages, or replace everything with {{Cost}}?
Title: Re: Templates and documentations
Post by: TwiNight on November 08, 2012, 02:40:27 am
Cost

So how do we keep it with the {{Coin}} and {{P}} template then? I see that you used them in your template, but do we want to keep them on the pages, or replace everything with {{Cost}}?

Those are fine. The {{Cost}} is mainly for building other templates
But if the bot can do the job, why not?
Title: Re: Templates and documentations
Post by: DStu on November 08, 2012, 03:09:18 am
Cost

So how do we keep it with the {{Coin}} and {{P}} template then? I see that you used them in your template, but do we want to keep them on the pages, or replace everything with {{Cost}}?

Those are fine. The {{Cost}} is mainly for building other templates
But if the bot can do the job, why not?
It can.  It's mainly good for the bot itself, if you later want to change something, and half of the templates are {{coin|}} and the other half {{cost|}}, and then there are some Coin and Cost also, you really get mad.
Also, your template is nicer for the bot, as the text is just {{Cost|$text}} and does not need all these Potions and stars and Qs and whatever, so once everything is in this form, it can be captured with just one simple regex.

Probably we can also really rename then {{coin|}} and {{P}} to mark that they are for internal use only.

Edit: But if I see it right, the template can not handle the ? and x yet?
Title: Re: Templates and documentations
Post by: TwiNight on November 08, 2012, 03:53:12 am
Edit: But if I see it right, the template can not handle the ? and x yet?

Nice catch! Now it can. Added some special cases for them
I hate special cases, but they would be gone anyway after Qvist get the StringParsers up
Title: Re: Templates and documentations
Post by: TwiNight on November 08, 2012, 04:23:37 am
btw, should change {{P}} in the Main namespace to {{Cost|P}} too
Title: Re: Templates and documentations
Post by: TwiNight on November 09, 2012, 02:46:08 am
Made a generic Infobox meta-template, and testing out a new Infobox Card template

At the meantime, time to standardize the format of card categories to plural + first word capitalize ("Action cards")?

regexp replace: \[\[Category:(.*)[cC]ard\]\]  to  [[Category:$1cards]]
Title: Re: Templates and documentations
Post by: DStu on November 09, 2012, 03:02:52 am
regexp replace:
Code: [Select]
\[\[Category\:([^\]]*)[cC]ards{,1}\]\]  to  [[Category:\1cards]]

FTFM
Title: Re: Templates and documentations
Post by: thirtyseven on November 09, 2012, 10:34:40 am
Template request: This (http://en.wikipedia.org/wiki/Wikipedia:PIC#Co-aligning), to use in the Double-Tactician article and the Combo articles.
Title: Re: Templates and documentations
Post by: TwiNight on November 09, 2012, 11:41:30 am
Infobox Combo is on my to-do already

Meanwhile, if StuBot would like to start working on the replace so I can publish the Infobox Card......
Title: Re: Templates and documentations
Post by: DStu on November 09, 2012, 11:52:12 am
Infobox Combo is on my to-do already

Meanwhile, if StuBot would like to start working on the replace so I can publish the Infobox Card......
The Stu has to go home first, and I don't know if I have much time tonight to run new scripts. Any Priorities? the Category one?
Title: Re: Templates and documentations
Post by: TwiNight on November 09, 2012, 12:14:12 pm
Infobox Combo is on my to-do already

Meanwhile, if StuBot would like to start working on the replace so I can publish the Infobox Card......
The Stu has to go home first, and I don't know if I have much time tonight to run new scripts. Any Priorities? the Category one?
The Category one. My Infobox Card complies with that category naming convention and I want to make sure it works before actually using it
Title: Re: Templates and documentations
Post by: DStu on November 09, 2012, 12:57:31 pm
The categories are actually not on the page, but in http://wiki.dominionstrategy.com/index.php/Template:Cardbox
Title: Re: Templates and documentations
Post by: TwiNight on November 09, 2012, 01:36:55 pm
The categories are actually not on the page, but in http://wiki.dominionstrategy.com/index.php/Template:Cardbox
But then those on the category pages themselves (like "Category: Card" on "Category: Action card") still have to be fixed

EDIT: nvm, I can manually fix that given the volume is small enough
EDIT2: Fixed. Some admin can start deleting the now non-existent categories listed here (http://wiki.dominionstrategy.com/index.php/Category:Card) (execpt "Combo")
Title: Re: Templates and documentations
Post by: jonts26 on November 10, 2012, 03:00:24 am
TwiNight, I just wanted to say you are doing an awesome job with all the new templates. Things are looking really good. Keep it up.
Title: Re: Templates and documentations
Post by: DStu on November 10, 2012, 08:42:50 am
I'm botting Cardbox->Infobox Card.
Hope I captured everything.
Title: Re: Templates and documentations
Post by: TwiNight on November 10, 2012, 03:58:26 pm
I'm botting Cardbox->Infobox Card.
Hope I captured everything.
Oh you did that for me!
I was trying to make a new Cardbox so that {{subst:Cardbox}} will give the Infobox so you can just replace Cardbox to subst:Cardbox, but fell asleep and you already finished it when I woke up. (And you fixed all those text2 and large {{Cost}} and large {{VP}} !!!!

Nonetheless, it would be better to include the |kingdom = Yes param despite it will default so.
And Ruins pages also defaulted to |kingdom = Yes ......, among other minor things. I can fix those manually

e: And Prizes and Madman and Mercenary
Title: Re: Templates and documentations
Post by: TwiNight on November 10, 2012, 06:13:35 pm
News:
Infobox 2CardCombo done. But honestly not much can be put into the Infobox
Title: Re: Templates and documentations
Post by: DStu on November 10, 2012, 07:56:21 pm
I'm botting Cardbox->Infobox Card.
Hope I captured everything.
Oh you did that for me!
I was trying to make a new Cardbox so that {{subst:Cardbox}} will give the Infobox so you can just replace Cardbox to subst:Cardbox, but fell asleep and you already finished it when I woke up. (And you fixed all those text2 and large {{Cost}} and large {{VP}} !!!!

Nonetheless, it would be better to include the |kingdom = Yes param despite it will default so.
And Ruins pages also defaulted to |kingdom = Yes ......, among other minor things. I can fix those manually

e: And Prizes and Madman and Mercenary
Yeah, I didn't really notice this |kingdom option on the cards I looked at to decide what the template should look like, so it's basically nowhere.
Title: Re: Templates and documentations
Post by: TwiNight on November 10, 2012, 11:42:29 pm
I'm botting Cardbox->Infobox Card.
Hope I captured everything.
Oh you did that for me!
I was trying to make a new Cardbox so that {{subst:Cardbox}} will give the Infobox so you can just replace Cardbox to subst:Cardbox, but fell asleep and you already finished it when I woke up. (And you fixed all those text2 and large {{Cost}} and large {{VP}} !!!!

Nonetheless, it would be better to include the |kingdom = Yes param despite it will default so.
And Ruins pages also defaulted to |kingdom = Yes ......, among other minor things. I can fix those manually

e: And Prizes and Madman and Mercenary
Yeah, I didn't really notice this |kingdom option on the cards I looked at to decide what the template should look like, so it's basically nowhere.
On deeper thought tough, I don't think that kingdom param matters that much.
Meanwhile, you can remove the |set param from the infoboxes now that I have the Card2set template
Title: Re: Templates and documentations
Post by: DStu on November 11, 2012, 05:19:34 am
Meanwhile, you can remove the |set param from the infoboxes now that I have the Card2set template
Done.
Title: Re: Templates and documentations
Post by: TwiNight on November 12, 2012, 04:28:13 am
Some news:
Infobox Website done, though not much use.
Infobox Card now has an "a.k.a." param. (Not something the bot can implement)
Uploaded set icons and implemented those in Infobox Card and Kingdom Templates. (See Template:Icon)
Title: Re: Templates and documentations
Post by: TwiNight on November 13, 2012, 05:32:23 am
TwiNight, I just wanted to say you are doing an awesome job with all the new templates. Things are looking really good. Keep it up.

Just noticed,
A post praising someone for his good job getting more up votes than the praised.
Title: Re: Templates and documentations
Post by: ftl on November 13, 2012, 10:11:46 pm
BTW, the [[Kingdom card]] link which is on each cardbox redirects to the [[Kingdom]] page which has been deleted.

That's sort of weird. What used to be there before it was deleted? Did it get moved somewhere? Should that not be a link any longer?

[edit] nevermind, found where it's supposed to go I think
[edit] nevermind, just redirected it to gameplay
Title: Re: Templates and documentations
Post by: jonts26 on November 13, 2012, 10:23:18 pm
Yeah the kingdom page was like one and a half sentences. I probably should have just redirected it instead of deleting it outright but that's why I'm counting on you guys to clean up my messes.
Title: Re: Templates and documentations
Post by: michaeljb on November 14, 2012, 01:47:36 pm
I just added a new template, NewCard. It just gets $card-new.jpg instead of $card.jpg so that the new art for the Base Cards can be used when hovering over.

I just copied the Card template and changed the file it gets, so there might be a better/cleverer way to handle this, but it seemed good enough. Just use {{NewCard|Province}}.

:e I have applied the NewCard template to the list on the Base Cards (http://wiki.dominionstrategy.com/index.php/Base_Cards) page, and the Base Cards section in the Navbox Cards (http://wiki.dominionstrategy.com/index.php/Template:Navbox_Cards).
Title: Re: Templates and documentations
Post by: greatexpectations on November 26, 2012, 11:31:54 pm
question for some of you template folks: can you hook us up with the template needed to format a references section? i'm looking for something like {{Reflist|2}} so i can create neat two column reference sections. it's a non-issue for most pages, but i am slowly working on improving the goko and isotropic pages and any attempts at objectivity there will require citing sources.
Title: Re: Templates and documentations
Post by: thirtyseven on November 26, 2012, 11:46:09 pm
question for some of you template folks: can you hook us up with the template needed to format a references section? i'm looking for something like {{Reflist|2}} so i can create neat two column reference sections. it's a non-issue for most pages, but i am slowly working on improving the goko and isotropic pages and any attempts at objectivity there will require citing sources.

I added <small></small> tags to those two pages, which will at least provide a temporary fix if you think we still need a two-column reference template... what do you think?
Title: Re: Templates and documentations
Post by: greatexpectations on November 27, 2012, 12:00:07 am
I added <small></small> tags to those two pages, which will at least provide a temporary fix if you think we still need a two-column reference template... what do you think?

yeah that should do until we can get a template. assuming doing that sort of thing isn't all that hard of course. i really have no idea, i just write stuff.
Title: Re: Templates and documentations
Post by: TwiNight on November 28, 2012, 07:04:12 pm
I added <small></small> tags to those two pages, which will at least provide a temporary fix if you think we still need a two-column reference template... what do you think?

yeah that should do until we can get a template. assuming doing that sort of thing isn't all that hard of course. i really have no idea, i just write stuff.

I don't think that possible, considering it is one unbreakable block of <reference/>......
Title: Re: Templates and documentations
Post by: greatexpectations on November 28, 2012, 07:37:41 pm
I don't think that possible, considering it is one unbreakable block of <reference/>......

i'm referring to something like this (http://en.wikipedia.org/wiki/David_Wright#References). it breaks the references down into two columns. looking at the source for that reference section shows:
==References==
{{Reflist|2}}
Title: Re: Templates and documentations
Post by: TwiNight on November 29, 2012, 04:06:30 pm
I don't think that possible, considering it is one unbreakable block of <reference/>......

i'm referring to something like this (http://en.wikipedia.org/wiki/David_Wright#References). it breaks the references down into two columns. looking at the source for that reference section shows:
==References==
{{Reflist|2}}

I thought wp is using ground work that we don't have but it turns out it only uses CSS3
Still, it won't work for IE at the time

e: Done and edited Iso and Goko pages
Title: Re: Templates and documentations
Post by: greatexpectations on November 29, 2012, 08:58:43 pm
just saw the change! much appreciated.