Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
(14 intermediate revisions by 4 users not shown)
Line 9: Line 9:
 
**Bonuses still on gear: armor/block (shields only)/crit/haste/hit/mastery
 
**Bonuses still on gear: armor/block (shields only)/crit/haste/hit/mastery
 
*I intend to have those attributes/bonuses explicitly listed and not defined as <code><nowiki>|attrib=+125 stam<br/>+250 int</nowiki></code>
 
*I intend to have those attributes/bonuses explicitly listed and not defined as <code><nowiki>|attrib=+125 stam<br/>+250 int</nowiki></code>
*Syntax on wiki-pages will be slightly more humane than what we're having to do now.
+
*Syntax on wiki-pages will be more humane than what we're having to do now.
 
On-article syntax I've been thinking about would be something along the lines of:
 
 
<code><nowiki><tooltip name="kd3's awesome item"
 
id=12345 <!-- will be mandatory in the tooltip itself, even though we're not going to display it like we do for quests -->
 
icon="inv weapon thunderfury" <!-- I'm assuming quotes are probably going to be necessary. this may not be the case. -->
 
q=e <!-- "quality: epic". type as much or as little as you like as long as you're not being ambiguous -->
 
bind=p <!-- example: e-equip, p-pickup, u-use, a-account. you could also use the keywords bop/boe/bta/bou -->
 
unique <!-- just the presence of the keyword is enough. if it's special--Unique (50), u=50 will work -->
 
armor=123
 
type=2h sword <!-- cloth head? back? gun? ->
 
block=9001
 
sta=22 <!-- explicitly defined! item doesn't have any stamina? don't add it -->
 
int=22
 
str=22
 
agi=22
 
spr=22
 
hit=150
 
haste=300
 
crit=450
 
mastery=9001
 
equip="Something special not covered by hit/haste/crit/mastery"
 
equip="Multiple equip lines? Gasp!"
 
use="A use line too"
 
read
 
open
 
unlock=450
 
/></nowiki></code>
 
   
 
The parser needs to do the grunt work, not secondary users like {{t|item}} or the javascript tooltips and especially not random users trying to add tooltips to the wiki. Chances are this is going to require changes to item/itembox/etc, but not if it can be helped. I dunno about the auto-categorization issue either.
 
The parser needs to do the grunt work, not secondary users like {{t|item}} or the javascript tooltips and especially not random users trying to add tooltips to the wiki. Chances are this is going to require changes to item/itembox/etc, but not if it can be helped. I dunno about the auto-categorization issue either.
Line 55: Line 27:
 
::Want to display an itemlink for {{t|item}}? <itemlink id=foo> or <itemlink name="bar">. Want to get an icon for {{t|costitem}} or {{t|itembox}}? <icon id=foo>. And so on.
 
::Want to display an itemlink for {{t|item}}? <itemlink id=foo> or <itemlink name="bar">. Want to get an icon for {{t|costitem}} or {{t|itembox}}? <icon id=foo>. And so on.
 
::Re updates to the code -- how often do we have to change {{t|tooltip}}? Every few minor content patches with big changes centered around expansions? (Guess why I'm trying to do this ''now''...) If the turnaround time is under a day or two I don't see much pain to be had. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 04:37, December 5, 2009 (UTC)
 
::Re updates to the code -- how often do we have to change {{t|tooltip}}? Every few minor content patches with big changes centered around expansions? (Guess why I'm trying to do this ''now''...) If the turnaround time is under a day or two I don't see much pain to be had. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 04:37, December 5, 2009 (UTC)
  +
:::Up to v0.5. The parser for key-mode is nearly done. Still need to write code for unique[-eq], set pieces and locked. Still thinking about how to handle the native language case (think: copy/pasting a tooltip from the armory/wowhead/curse in to our edit box and having it work properly). I'll probably come up with an answer when I wake up. (Yay sleep!)
  +
:::Also trying to decide how I want to put items in the database. Ideas? Please poke crucially/uberfuzzy if you see them on IRC. The techs need to be in on this too. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 08:57, December 5, 2009 (UTC)
  +
::::Stroke of genius when I woke up (I love when I do that). <item>[insert copy/paste from armory]<item> or <item name=foo .../>. The latter is mostly done, will work on the former when I get off work. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 19:28, December 5, 2009 (UTC)
  +
:::::What about icons? --{{User:Pcj/sig}} 19:41, December 5, 2009 (UTC)
  +
::::::Obviously I'm going to have to make a few concessions to get non-displayable info parsed: icon, quality, qbegin to name a few. I'm in the middle of writing the parser for this syntax now, see [[User:Kaydeethree/tooltip]]/body.php for what I've got so far. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 08:34, December 6, 2009 (UTC)
  +
  +
I take it the auto-cat is out the window now? {{User:Coobra/Sig4}} 09:02, December 6, 2009 (UTC)
  +
:Actually, far from it. Now that the script has a better handle on what these items actually are, the auto-categorization can be more complete. I'm still trying to get the parser(s) written. Then handling non-displayed information. Then trying to figure out how to hook in to the database. etc. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 09:22, December 6, 2009 (UTC)
  +
  +
== Parsers done (more or less) ==
  +
Okay... At this point, the parsers for both methods are pretty much done. They're a bunch of brute-force hacks, but hey, it's a start.
  +
  +
Please feel free to hack on the code. It's far from where I'd like it to be efficiency-wise, but that's still a long ways off.
  +
  +
Now then, time to go scare the hell out of the techs. I still have yet to handle any form of database input, but that decision needs to be made soonish. If they don't go screaming out of the room at mention of SMW, what say you? Do we just stick in <code><nowiki>[[Category:Foo]] [[Category:Bar]]</nowiki></code> in the render methods?
  +
  +
That's something I still need to figure out how to handle as well: the alternative use-cases. Please chime in if you have ideas--<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 23:49, December 6, 2009 (UTC)
  +
:I don't think we should do automatic categorization, those are more prone to change than the actual tooltip structure. --{{User:Pcj/sig}} 00:00, December 7, 2009 (UTC)
  +
::If you can hook SMW through to give automatic semantic data, that would be better than categorizing. It's an issue I've long pondered though: implementation of [item] categories if WoWWiki starts using SMW. Super size to [[:Category:Swords]] or some such and ignore the uber-specific categories currently used to be left to be generated as semantic data via SMW? --[[User:Sky2042|Sky]] ([[User talk:Sky2042|t]] · [[Special:Contributions/Sky2042|c]] · [http://www.wowhead.com/?user=Skyfire w]) 00:37, December 7, 2009 (UTC)
  +
  +
==Hooking in to SMW==
  +
So... I've made the plunge and hooked into SMW. Right now I'm only putting data in the tables. I've yet to get anything out of them for uses such as {{t|Item}}. Or, you know... using SMW. v0.10's been uploaded on [[User:Kaydeethree/tooltip]]. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 22:26, December 20, 2009 (UTC)
  +
  +
:Oh, I should mention: If any of you want to play around on my dev wiki, [[Special:EmailUser/Kaydeethree|contact me off-wiki]] or on IRC. I'm running it from my computer and I'd rather not get beaten off the net because I don't have any bandwidth. --<span style="border-bottom: 1px dotted;cursor:help;" title="WoWWiki bureaucrat">[[User:Kaydeethree|k]]_[[User_talk:Kaydeethree|d]]<sup>[[Special:Contributions/Kaydeethree|3]]</sup></span> 22:29, December 20, 2009 (UTC)

Revision as of 22:29, 20 December 2009

Forums: Village pump → New tooltip extension in php proposal

So... Cataclysm is coming. We're going to have to change all ~31,500 item tooltips anyway.

Why not take advantage of this to kill {{Tooltip}} and roll our own extension written in php? One less interpreted language to deal with and it'll still work with things like {{Item}}.

Things to keep in mind:

  • We only will have 11(ish) stats to keep track of instead of the 20+ we have now:
    • character sheet five: agility/intellect/spirit/stamina/strength
    • Bonuses still on gear: armor/block (shields only)/crit/haste/hit/mastery
  • I intend to have those attributes/bonuses explicitly listed and not defined as |attrib=+125 stam<br/>+250 int
  • Syntax on wiki-pages will be more humane than what we're having to do now.

The parser needs to do the grunt work, not secondary users like {{item}} or the javascript tooltips and especially not random users trying to add tooltips to the wiki. Chances are this is going to require changes to item/itembox/etc, but not if it can be helped. I dunno about the auto-categorization issue either.

Thoughts? I have yet to write any code; that's going to start soonish. --k_d3 01:40, December 2, 2009 (UTC)

This would probably be best done using Semantic MediaWiki, otherwise I'm pretty sure it would require some fancy template work to make it work with {{loot}} et al. --PcjWowpedia wiki manager (TDrop me a line!C207,729 contributions and counting) 01:43, December 2, 2009 (UTC)
If we could get it to work that way it'd be better. The question is, will crucially kill us in our sleep for enabling SMW on wikia's biggest wiki? --k_d3 01:47, December 2, 2009 (UTC)
Though if we do go the SMW route I'd probably shelve the tooltip extension option and reconfig {{Tooltip}} to handle the semantic metadata instead.
Saner on-article syntax is key whatever route we choose. --k_d3 02:49, December 2, 2009 (UTC)
One thing about that is I'm not sure you could do the multiple "equip" thing that way... --PcjWowpedia wiki manager (TDrop me a line!C207,729 contributions and counting) 02:52, December 2, 2009 (UTC)
It should be doable. Just need to get started working on the parser. Proof of concept code is up at User:Kaydeethree/tooltip. --k_d3 00:00, December 3, 2009 (UTC)
Looks fine. --PcjWowpedia wiki manager (TDrop me a line!C207,729 contributions and counting) 00:25, December 3, 2009 (UTC)
I'm not sure whether shifting some part of this implementation to PHP is a good idea -- the extension would probably not be editable by most users/admins, so the turnaround time for any updates it would require is a concern. From here, the XML tag syntax isn't much better than MW's template syntax; we could probably just as easily clean up the tooltip template to look about the same. [Performance-wise, it's worth investigating how template output can be cached.]
If we're going the full-blown PHP extension route, it might be more interesting to have things like <tooltip item="12345"/> and let the software be responsible for maintaining a cache of item stats. There is a potential issue with PTR or uncommon items, but perhaps that can be addressed in some fashion. -- foxlit (talk) 03:26, December 5, 2009 (UTC)
The more simple the on-wiki syntax the extension is able to parse the better. I'm still in the "let's get something written; ease of use be damned" phase. Feel free to tweak my code, though I should probably put it on github or gcode to be easier. Without even me trying to, my little testwiki's already caching what output I'm creating, so I expect explicitly putting mostly-formatted tooltips in the message cache and then pulling from the cache for js tooltips/etc will only help keep crap from hitting the database.
We still need to define the items on-wiki somewhere (so we can handle ptr/beta stuff), but yah, my intent for doing this is to get items directly in the database so we can reference stuff by its id/name and not have to overload {{tooltip}} yet again. Probably by (ab)using SMW if crucially doesn't kill us for suggesting it -- I'd rather not have to define "yet another wow item schema"... That is, if he'd ever get on irc when I am.
Want to display an itemlink for {{item}}? <itemlink id=foo> or <itemlink name="bar">. Want to get an icon for {{costitem}} or {{itembox}}? <icon id=foo>. And so on.
Re updates to the code -- how often do we have to change {{tooltip}}? Every few minor content patches with big changes centered around expansions? (Guess why I'm trying to do this now...) If the turnaround time is under a day or two I don't see much pain to be had. --k_d3 04:37, December 5, 2009 (UTC)
Up to v0.5. The parser for key-mode is nearly done. Still need to write code for unique[-eq], set pieces and locked. Still thinking about how to handle the native language case (think: copy/pasting a tooltip from the armory/wowhead/curse in to our edit box and having it work properly). I'll probably come up with an answer when I wake up. (Yay sleep!)
Also trying to decide how I want to put items in the database. Ideas? Please poke crucially/uberfuzzy if you see them on IRC. The techs need to be in on this too. --k_d3 08:57, December 5, 2009 (UTC)
Stroke of genius when I woke up (I love when I do that). <item>[insert copy/paste from armory]<item> or <item name=foo .../>. The latter is mostly done, will work on the former when I get off work. --k_d3 19:28, December 5, 2009 (UTC)
What about icons? --PcjWowpedia wiki manager (TDrop me a line!C207,729 contributions and counting) 19:41, December 5, 2009 (UTC)
Obviously I'm going to have to make a few concessions to get non-displayable info parsed: icon, quality, qbegin to name a few. I'm in the middle of writing the parser for this syntax now, see User:Kaydeethree/tooltip/body.php for what I've got so far. --k_d3 08:34, December 6, 2009 (UTC)

I take it the auto-cat is out the window now? SnakeSssssssssssssssssssssssss Coobra sig3For Pony! (Sssss/Slithered) 09:02, December 6, 2009 (UTC)

Actually, far from it. Now that the script has a better handle on what these items actually are, the auto-categorization can be more complete. I'm still trying to get the parser(s) written. Then handling non-displayed information. Then trying to figure out how to hook in to the database. etc. --k_d3 09:22, December 6, 2009 (UTC)

Parsers done (more or less)

Okay... At this point, the parsers for both methods are pretty much done. They're a bunch of brute-force hacks, but hey, it's a start.

Please feel free to hack on the code. It's far from where I'd like it to be efficiency-wise, but that's still a long ways off.

Now then, time to go scare the hell out of the techs. I still have yet to handle any form of database input, but that decision needs to be made soonish. If they don't go screaming out of the room at mention of SMW, what say you? Do we just stick in [[Category:Foo]] [[Category:Bar]] in the render methods?

That's something I still need to figure out how to handle as well: the alternative use-cases. Please chime in if you have ideas--k_d3 23:49, December 6, 2009 (UTC)

I don't think we should do automatic categorization, those are more prone to change than the actual tooltip structure. --PcjWowpedia wiki manager (TDrop me a line!C207,729 contributions and counting) 00:00, December 7, 2009 (UTC)
If you can hook SMW through to give automatic semantic data, that would be better than categorizing. It's an issue I've long pondered though: implementation of [item] categories if WoWWiki starts using SMW. Super size to Category:Swords or some such and ignore the uber-specific categories currently used to be left to be generated as semantic data via SMW? --Sky (t · c · w) 00:37, December 7, 2009 (UTC)

Hooking in to SMW

So... I've made the plunge and hooked into SMW. Right now I'm only putting data in the tables. I've yet to get anything out of them for uses such as {{Item}}. Or, you know... using SMW. v0.10's been uploaded on User:Kaydeethree/tooltip. --k_d3 22:26, December 20, 2009 (UTC)

Oh, I should mention: If any of you want to play around on my dev wiki, contact me off-wiki or on IRC. I'm running it from my computer and I'd rather not get beaten off the net because I don't have any bandwidth. --k_d3 22:29, December 20, 2009 (UTC)