Page MenuHomePhabricator

[RfC] Find a name for mw.wikibase.renderSnak(s) alternative with richt wikitext output
Closed, ResolvedPublic

Description

We currently have mw.wikibase.renderSnak and mw.wikibase.renderSnaks which render a Snak/ Snaks to Wikitext escaped plain text.

We also want to provide such functions that emit rich wikitext, so that for example qualifiers and references can easily be formatted. Similar to what we did with the new mw.wikibase.entity:formatStatements, we need to create new functions for this, with a new name.

I suggest to name these mw.wikibase.formatValue/ mw.wikibase.formatValues or mw.wikibase.formatSnak/mw.wikibase.formatSnaks. The first one has the advantage that it doesn't contain Snak (a term we don't want to expose).

Event Timeline

hoo created this task.Nov 8 2016, 10:17 AM
hoo added a subscriber: Jonas.Nov 9 2016, 3:22 PM

@Jonas Suggested mw.wikibase.renderRichSnak and mw.wikibase.renderRichSnaks in r320593. I don't like these much, because they a) contain Snak and b) suggest that they are rendering "rich Snaks".

That was me, in a code experiment/pair session with a job candidate. I don't like renderRichSnak(s) either, this was literally what first came into my mind. I'm absolutely fine with formatValue(s).

Lucie added a comment.Nov 11 2016, 8:34 PM

It would be great to not expose the word snak anymore. I think it's pretty confusing for people using the Lua functions not being familiar with the internal structure. Anyway, formatValues() sounds good to me, too!

hoo closed this task as Resolved.Dec 6 2016, 12:32 PM
hoo assigned this task to thiemowmde.

This was implemented as mw.wikibase.formatValue/ mw.wikibase.formatValues in 57c92e2f39510e3538c2a316dd05e1a1d989c8f6 by @thiemowmde.