Page MenuHomePhabricator

Internal links supports parameters spliced by vertical bar
Open, LowPublic

Description

In a discussion on zh.wp ,someone wanted that the internal links can support parameters so that he can write the internal link easiler without {{fullurl:}}.

As I know,Some Special Page can support that it included with parameters which spliced by vertical bar. I think it can use the same idea to make the links on the part of processing internal link.

Model:

[[<target>|<parameters, must be the key-value table>...|<show name>]]

Example:

[[:en:Main Page|action=edit|Main Page of en.wp]]

->

<a href="https://en.wikipedia.org/wiki/Main_Page?action=edit">Main Page of en.wp</a>
[[:en:Main Page|action=history|year=2016|month=-1|tagfilter=|Main Page's history of en.wp]]

->

<a href="https://en.wikipedia.org/w/index.php?title=Main_Page&action=history&year=2016&month=-1&tagfilter=">Main Page's history of en.wp</a>
[[:en:Main Page|action=history|year=2016|month=-1|tagfilter=]]

->

<a href="https://en.wikipedia.org/w/index.php?title=Main_Page&action=history&year=2016&month=-1&tagfilter=">[1]</a> (External links style)

Event Timeline

Cwek removed Shizhao as the assignee of this task.May 5 2016, 4:21 AM
Cwek triaged this task as Low priority.
Cwek updated the task description. (Show Details)
Cwek added subscribers: Shizhao, liangent.
Cwek added subscribers: Antigng, Nbdd0121.

I personally am not a fan of this idea. Syntax is complicated enough as it is (imho).

I am against adding this. As Bawolff said, this could make syntax more complex. We have more straightforward way to solve the problem, for example, like stated in zh.wp's discussion, use a special page that mimics Special:Diff (named Special:Action for example).

I am against adding this. As Bawolff said, this could make syntax more complex. We have more straightforward way to solve the problem, for example, like stated in zh.wp's discussion, use a special page that mimics Special:Diff (named Special:Action for example).

I personally am not a fan of this idea. Syntax is complicated enough as it is (imho).

Is it complex?

We can think the link parameters looks like a php array. Cell index 0 is the page target ,cell index 1 (the last index cell) is the name which be shown, other cells are the key-value table for the parameters to transferred to build the query parameters. And if the key-value table have the number key, make them as the character key.

I don't think it's a good idea to depend on the special page. The value which have question mark and slash is not easy to interpret but it have been resolved by target's interpretation and the solution of the template's parameters. And it's just a extensiveness of the internal link's syntax which add a part to find the parameters.

By the way, for some parameters can effect the target, like the 'title', these parameters need to ignore for processing.