Page MenuHomePhabricator

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


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" 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)?

Event Timeline

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

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.

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.

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