Add templated version of wiki href to link element in presets

Simon Poole simon at poole.ch
Sat Nov 3 15:22:36 UTC 2018


The current default preset has 12'214 lines of which roughly 5'564 are
used for href attributes in the "link" element. I actually suspect that
the number of lines used for the href entries is increasing faster than
the actual preset content and it is only a matter of time before they
will outnumber the rest. This makes the, already far too large file,
larger than necessary and requires continuous maintenance of the entries
for no good reason.

If we used a template this could be reduced to 1'500 plus a couple of
potential special cases. My suggestion would be to add a "template"
attribute to the link element, with a placeholder {country} (or similar)
for the two letter iso code plus the colon (including the colon makes
adding a special entry for EN unnecessary).

Example:

<link
template="http://wiki.openstreetmap.org/wiki/{country}Tag:route=railway" />

Special cases could still be handled with xx.href attributes.

The downside of doing it this way is that in the case the page doesn't
exist it will need a retry without the country + colon, however I would
consider that bearable, alternatively we could an attribute holding the
countries for all existing versions, but I don't really think that is
worth the trouble.

Comments? Better suggestions?

Simon


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/josm-dev/attachments/20181103/6fe0b9ce/attachment.sig>


More information about the josm-dev mailing list