Page MenuHomePhabricator

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

Description

We currently have [[https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.renderSnak|mw.wikibase.renderSnak]] and [[https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua#mw.wikibase.renderSnaks|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

@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).

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 assigned this task to thiemowmde.

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