Create shortcut/alias for aligned parameter style in TemplateData
Open, Needs TriagePublic

Description

One of the most common template formatting styles (on English Wikipedia at least) is to use whitespace to align all the parameter values vertically. Apparently, in the TemplateData data you can set something like:

"format": "{{_\n| ________________________ = _\n}}\n"

...to emulate this style. Could we create a shortcut/alias for this similar to "format: inline" and "format: block"? While we're at it, could we have it automatically calculate the right amount of whitespace to clear all the parameter names (within a reasonable limit)?

kaldari created this task.Feb 6 2018, 6:58 PM

Change 408593 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Don't try to bump parser resource use if setPageSrcInfo is throwing exceptions

https://gerrit.wikimedia.org/r/408593

cscott added a comment.Feb 6 2018, 7:58 PM

Argument name space-padding is (apparently) considered a discouraged practice on dewiki, if I understand correctly. When a new longer argument name is added, all of the existing arguments need to get spaces added, and that (human-created) dirty diff is frowned upon.

For some context on the original format string spec, see T138492: Add support for actual format strings to TemplateData's "format" parameter.

Dvorapa added a subscriber: Dvorapa.Feb 6 2018, 8:39 PM
Alsee added a comment.Feb 7 2018, 12:55 AM

Is there a reason this is a subtask of T179259? They both involve working on the same region of code, but the tasks are not related.

I made it a subtask since it is designed to mitigate the effects of T179259, but doesn't entirely solve the issue.

Alsee added a comment.EditedFeb 7 2018, 9:08 AM

@kaldari it doesn't mitigate T179259 at all. It is more likely to increase dirty diffs than reduce them, making the problem worse. And it does nothing to prevent VE from editwarring.

If this task was created because of T179259 then don't waste time building it, work on T179259 instead. If there's independent interest in building this, then please do so after the higher priority task T179259.