DiffOnly
Hi, I installed DiffOnly, and I think I will find it very useful. However, it doesn't work for histories, either when I use DiffOnly = "all" or DiffOnly = "history". I'm using MonoBook. I tried using just this script, so it's not a conflict with other (non-gadget) scripts. MANdARAX • XAЯAbИAM 21:49, 24 October 2021 (UTC)
- @Mandarax: It looks like the structure of the history page HTML changed slightly, which was stopping the CSS selector I used from finding the diff links. I have now fixed it, so you should start seeing diff-only links for history pages now. Let me know if you find any issues with it. Best — Mr. Stradivarius ♪ talk ♪ 13:37, 25 October 2021 (UTC)
Nomination for deletion of Template:DYK error
Template:DYK error has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. Did Q28 make a mess today? 09:37, 16 November 2021 (UTC)
Doc request for Find_sources transformFunc
Hello, in this edit to Module:Find sources you added transformFunc to local function renderSearchString
. It looks like this might work for us, for a transformation we have in mind (fiddling with double quotes—not urlencoding them, but removing them, possibly shifting them from one incoming search arg to another). However, I don't see anything at Module:Find sources/doc that explains where the transform comes from, how to define it, or how to use it. Could you please add something to the /doc page explaining this, and perhaps including one or two examples, to make it clear? (Needn't be our use case, just a generic example useful to anybody who wants to use transformFunc.) I presume you added this because there was some RW use case for it; if you remember what it was, can you point me to it? Thanks, Mathglot (talk) 19:37, 16 November 2021 (UTC)
- @Mathglot: I'm not sure if this is what you want, but searching for
renderSearchString
in Module:Find sources shows the definition wheretransformFunc
is the third parameter to the function. If it is null, it is not used. Otherwise, it is used as a function that is applied to each string in thesearchStrings
table. Continuing the search showsrenderSearchString
is called twice, once withmw.uri.encode
as the third parameter, and once with nothing (null). For example, if you passedstring.lower
, that function would be applied to each search string. Or, you could have a private function that does whatever it wants with quotes in search strings, and pass that as the third parameter. Johnuniq (talk) 22:38, 16 November 2021 (UTC)- @Mathglot: What Johnuniq said. The transformFunc parameter can be any function that takes a string as input and returns a string as output, and transforms each of the search terms when making a search link. It is an internal implementation detail and probably doesn't belong on the /doc page, as it isn't used directly by template authors or end users. Having said that, it would probably be a good idea to expand the comment in the code about how it works. However, if you need to shift quotation marks from one argument to another, you will probably need to come up with a different mechanism, as transformFunc only works on individual search strings. I don't remember all the internal details of the module, but if you are adding quotation marks and then removing them in a later stage of processing, that might be a sign that a larger-scale re-architecting of the module may be warranted. — Mr. Stradivarius ♪ talk ♪ 01:40, 17 November 2021 (UTC)
- Thanks, both of you. I understand now that it isn’t public-facing and therefore /doc updates are not warranted here (internal comments always welcome). Regarding possible rearchitecting I may get back to you on that; there’s no pressing issue right now, but we have seen a few cases where the auto quoting of param1 leads to worse results in a couple of cases (e.g. for 'gin' and 'jstor' in */links/) and I was starting to muse about how to address this. Clearly I was barking up the wrong tree with transformFunc. Will put this on the back burner for now while more pressing issues are resolved (see WT:MED if curious), and perhaps we can chat about this again at a later point. Thanks again! Mathglot (talk) 01:57, 17 November 2021 (UTC)
- @Mathglot: What Johnuniq said. The transformFunc parameter can be any function that takes a string as input and returns a string as output, and transforms each of the search terms when making a search link. It is an internal implementation detail and probably doesn't belong on the /doc page, as it isn't used directly by template authors or end users. Having said that, it would probably be a good idea to expand the comment in the code about how it works. However, if you need to shift quotation marks from one argument to another, you will probably need to come up with a different mechanism, as transformFunc only works on individual search strings. I don't remember all the internal details of the module, but if you are adding quotation marks and then removing them in a later stage of processing, that might be a sign that a larger-scale re-architecting of the module may be warranted. — Mr. Stradivarius ♪ talk ♪ 01:40, 17 November 2021 (UTC)
Nomination for deletion of Template:Year in various calendars/old
Template:Year in various calendars/old has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. Did Q28 make a mess today? 00:33, 17 November 2021 (UTC)
Nomination for deletion of Template:Portal/old
Template:Portal/old has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. Did Q28 make a mess today? 00:40, 17 November 2021 (UTC)
Nomination for deletion of Template:Year in various calendars/Chinese
Template:Year in various calendars/Chinese has been nominated for deletion. You are invited to comment on the discussion at the entry on the Templates for discussion page. Did Q28 make a mess today? 05:20, 18 November 2021 (UTC)
Tech News: 2021-47
20:01, 22 November 2021 (UTC)