Jump to content

Wikipedia:Village pump (technical): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
gsdf;gksdfg: new section
Line 327: Line 327:
</pre>
</pre>
:::Those lines have nutty asterisk and indenting, followed by a line break in the middle of a wikilink. That's broken; don't expect it to work predictably. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:58, 8 January 2022 (UTC)
:::Those lines have nutty asterisk and indenting, followed by a line break in the middle of a wikilink. That's broken; don't expect it to work predictably. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 15:58, 8 January 2022 (UTC)

== gsdf;gksdfg ==

;lkslkjdlfg slgjklsdgl dg

Revision as of 17:02, 8 January 2022

 Policy Technical Proposals Idea lab WMF Miscellaneous 
The technical section of the village pump is used to discuss technical issues about Wikipedia. Bug reports and feature requests should be made in Phabricator (see how to report a bug). Bugs with security implications should be reported differently (see how to report security bugs).

Newcomers to the technical village pump are encouraged to read these guidelines prior to posting here. If you want to report a JavaScript error, please follow this guideline. Questions about MediaWiki in general should be posted at the MediaWiki support desk. Discussions are automatically archived after remaining inactive for five days.


The VE divide

Something I've been thinking a lot about recently is what I'm calling "the VE divide". Most experienced Wikipedians created their accounts before the well-circulated default state RfC. One of the things this RfC did, that I don't think was well-considered (or even considered at all) at the time, was enable the VE by default for new accounts. This created something I'm calling "the experienced Wikipedian VE divide", "VE divide" for short.

Other editors of similar or more experience have found it quite shocking that I always, or almost always, edit with the VE, and find the source editor to be an anachronism that hinders my ability to write articles. This has come up numerous times given a lot of my articles were written solely in the VE. It first came up in relation to the fact my VE-written articles had so many nonmeaningful ref names like :0, :1, so much so that I wrote a script (User:Psiĥedelisto/VisualEditor ref namer.py) to autoreplace these. It came up again at Talk:Osteogenesis imperfecta/GA1, where the reviewer just assumed I'd know how to do some complex source editor thing, but actually had to figure it out.

I'd like to write a project-space essay about the VE divide, but hesitate. It didn't matter to the RfC voters, should we care? And if it matters to the project now, does the VE divide rise to the level? Thanks for your time and any comments you leave. Psiĥedelisto (talkcontribs) please always ping! 13:16, 29 December 2021 (UTC)[reply]

If you care, feel free to write an essay. You don't need to ask permission. Regards,— JohnFromPinckney (talk / edits) 14:11, 29 December 2021 (UTC)[reply]
@JohnFromPinckney: Certainly, but the project space also shouldn't have essays no one else thinks are worthwhile, and I wouldn't want to write an essay only I'd want to read (I have plenty of such ideas but to everyone's benefit avoid them). Psiĥedelisto (talkcontribs) please always ping! 16:16, 29 December 2021 (UTC)[reply]
You can always draft it up as a subpage of User:Psiĥedelisto, publicise it in places like WT:VE and WP:VPR, encouraging people to comment or edit. Then when you have a few people in support, move it to WP: space; it can always be moved back if there is too much opposition. --Redrose64 🌹 (talk) 00:12, 30 December 2021 (UTC)[reply]
Yes we should care, but unfortunately ppl get very stuck in their ways and things like mobile and VE get ignored by those who don't want to deal with changes. It's a difficult problem to address as it is a human problem. —TheDJ (talkcontribs) 14:24, 29 December 2021 (UTC)[reply]
It really doesn't help that VE, upon initial release, was considered not fit for purpose. —A little blue Bori v^_^v Jéské Couriano 14:36, 29 December 2021 (UTC)[reply]
It's been almost 8 years. People have had kids that are now in middle school, or they themselves finished their entire medical school education, wars have started and ended. Several countries devolved back into full autocracies, the USA had 2 presidents, one of which called for and almost caused the USA to become a dictatorship itself. Things change. —TheDJ (talkcontribs) 15:57, 29 December 2021 (UTC)[reply]
@TheDJ: Sounds like a good alternate title: The VisualEditor is now in elementary school, joining many of its users. On second thought, let's forget it. Psiĥedelisto (talkcontribs) please always ping! 16:16, 29 December 2021 (UTC)[reply]
I, for one, would love to read such an essay. GorillaWarfare (she/her • talk) 15:30, 29 December 2021 (UTC)[reply]
@GorillaWarfare: That's all the confirmation I need that writing one would be worthwhile! Psiĥedelisto (talkcontribs) please always ping! 16:16, 29 December 2021 (UTC)[reply]
I'd also be really interested in an essay about this, and as a matter of fact I think I'm gonna go VE-only for a bit just to make sure I'm familiar with what newer editors are seeing. I'd seen the use of :0 and :1 as ref names before and just got slightly annoyed, wondering why the editors couldn't bother to be slightly more descriptive. Now I'm wondering what else I've jumped to assumptions about... Alyo (chat·edits) 21:17, 29 December 2021 (UTC)[reply]
Well, Visual Editor was in fact enabled by default for newly created accounts on the English Wikipedia, as seen in phab:T90664, however it did not roll out as intended phab:T132806.
The :01 format in references is used where the user uses an existing citation, which has not been named. Since VisualEditor handles the code itself, they wanted to use an universially unique name so it would not conflict with anything.--Snævar (talk) 00:16, 30 December 2021 (UTC)[reply]
@Snævar: True, but perhaps not the full story; for example, as Alyo notes, in the VE, there is no way to name a reference, even a VE-managed, VE-created reference. The only way to name a reference is to change to the source mode and do it manually; once a reference has a source mode name, then the reference will preserve its name even in the VE, no matter how much it is copied, etc. By the way—this is why VE editors like me tend to use {{rp}} and not the more common style among those who learned to edit earlier of putting page numbers and using {{harv}} for example, because it's such a nuisance to deal with VE cites, we tend to like to cite the source once, and use either {{rp}} or a group=note second cite to expand on anything that can't go into {{rp}}. If you want a concrete example of what a VE-created article (to the extent you consider me an "experienced" VE editor, heh) looks like, either 2channel or osteogenesis imperfecta are a good example; I wrote both basically entirely in the VE, only using source mode to fix bugs the VE introduced. Heavy use of {{rp}}, using group=note instead of {{sfn}} as it confuses the VE. I've gained an intuitive understanding of when something I'm doing has a high chance of causing one of the many VE bugs I'm familiar with, so usually know to immediately go to source mode and fix it. Despite its many flaws though, I can't imagine how people edit the old way, all of the pressing Show preview, manual typing of cites, having to find my place in the textbox again when the preview loads—this stuff just kills my productivity and is why I've stuck with the VE so long, choosing to work around its bugs rather than abandon it. (And in the process, created User:Psiĥedelisto/Userboxes/VisualEditor, complete with a bug apology, as the first thing you see on my user page—because I know I sometimes miss a bug the VE introduced into a big edit of mine.) Thank you both for the idea of content that's needed in this essay, I'll mention all of this, especially the reality of cite naming in the VE. Honestly, it took me almost a year of editing to even know that cites have names. I thought they were just numbered. Sorry about that. Psiĥedelisto (talkcontribs) please always ping! 05:29, 30 December 2021 (UTC)[reply]
WikEd's preview function is great because it doesn't reload the page. ― Qwerfjkltalk 11:39, 30 December 2021 (UTC)[reply]
You don't need wikEd for that. SourceEditor with the Live preview + syntaxhighlight options enabled does the same. And wikEd is broken in significant ways due to lack of maintenance. The only real reason to use wikEd is for some of it's text formatting cleanup routines. —TheDJ (talkcontribs) 12:59, 30 December 2021 (UTC)[reply]
@TheDJ: By "Live preview", are you referring to the "Show previews without reloading the page" option, or to the Real Time Preview for Wikitext project (which, as far as I'm aware, hasn't been made publicly available yet)? --Ahecht (TALK
PAGE
) 00:30, 4 January 2022 (UTC)[reply]
The first. —TheDJ (talkcontribs) 11:56, 4 January 2022 (UTC)[reply]
@Psiĥedelisto, the reviewer for your GA nomination started editing two months after you. I suspect that he just happened to run across something that most editors haven't. Whatamidoing (WMF) (talk) 20:28, 7 January 2022 (UTC)[reply]
I converted the script into a pywikibot script (badly) - User:Qwerfjkl/VEref.py ― Qwerfjkltalk 22:18, 7 January 2022 (UTC)[reply]

New page

Is there any way, to get a feed of new pages, that are made by autopatrolled users AND are not redirects to another page? Rlink2 (talk) 16:41, 1 January 2022 (UTC)[reply]

@Rlink2 You could always filter it from EventStreams. I took https://codepen.io/ottomata/pen/LYpPpxj?editors=1010 and quickly hacked together https://codepen.io/zanhecht/pen/poWVwPm?editors=1010. You can select the "page-create" stream, put "enwiki" as the database, set the user group filter to "autopatrolled", and set "Page is redirect" to "yes". --Ahecht (TALK
PAGE
) 00:12, 4 January 2022 (UTC)[reply]

How to loop a video in Ogg Theora player

Composite video of a tennis racquet rotated around the three axes – the intermediate one flips from the light edge to the dark edge

Hi video experts,

I made this Ogg Theora video file for Tennis racket theorem. When I click on the thumbnail, it plays once. As more than one iteration will demonstrate the principle better, is there a way to specify in Wikitext for it to loop? (I know I can add multiple iterations in the video file but that seems an inelegant hack.)

Thanks,
cmɢʟeeτaʟκ 22:21, 1 January 2022 (UTC)[reply]

there is no option for this right now. —TheDJ (talkcontribs) 08:51, 3 January 2022 (UTC)[reply]

MediaWiki functions for Lua modules

Hi, are there MW functions that can be used in Lua modules, which serve to differentiate between IPv4 and IPv6, and which detect whether a user with a certain name exists in local? Mw.util.isIP and its variants don’t seem to work in Lua modules. And if there’s any module that’s already been written and that involves these functionalities, I’d appreciate it if you could provide a link. Thanks. 2001:268:90AE:7C2B:40FC:BC23:135B:7882 (talk) 09:51, 2 January 2022 (UTC)[reply]

Template:IsIPAddress? ― Qwerfjkltalk 10:40, 2 January 2022 (UTC)[reply]
For use in a lua module, you'd want to use Module:IPAddress instead of {{IsIPAddress}}, e.g.:
require('Module:IPAddress')._isIp('192.168.0.1')
will return '4' or '6'. You can also use the :getVersion() method from Module:IP, e.g.:
require('Module:IP').IPAddress.new('192.168.0.1'):getVersion()
will return 'IPv4' or 'IPv6', or you can use the :isIPv4() and :isIPv6() methods if you need it to return a boolean. --Ahecht (TALK
PAGE
) 21:57, 3 January 2022 (UTC)[reply]

Authority control

Does anybody know what happened to Microsoft Academic? It was working a few days ago. And what kind of data can be shown in "authority control" section? I'm wondering why Microsoft Academic ID and ORCID are shown but not the Scopus and Google Scholar. Ali Pirhayati (talk) 12:29, 2 January 2022 (UTC)[reply]

Microsoft Academic says it closed December 31, 2021.[1] PrimeHunter (talk) 12:50, 2 January 2022 (UTC)[reply]
@GreenC: anything you can do here with archiving bots? Headbomb {t · c · p · b} 00:04, 4 January 2022 (UTC)[reply]
Headbomb, Done. -- GreenC 03:47, 4 January 2022 (UTC)[reply]
@GreenC: was more thinking about the bot being able to find archived versions of these links, rather than marking them as dead. Headbomb {t · c · p · b} 23:59, 4 January 2022 (UTC)[reply]
Headbomb: It edited 74 pages (not all related to this domain). Added 39 archive URLs (Example). 25 {{dead link}} when no archive is available. For whatever reason the domain had a high proportion of unavailable archive links. - GreenC 01:01, 5 January 2022 (UTC)[reply]

Underlining Chinese characters can be confusing

The article Goat (zodiac) starts like this: The Goat (Chinese: ; pinyin: yáng.

So, the character 羊 has four horizontal lines here, but three in other parts of the article and also in the Wiktionary article linked. It took me a while to understand that it is because the character is underlined. Does this even make sense? I don't think the Chinese ever underline characters, and I bet there are instances where this changes the meaning. Should there be an exception in this Wiki code for Chinese characters, or an option to omit the underlining? --Hob Gadling (talk) 08:38, 3 January 2022 (UTC)[reply]

@Hob Gadling By default links are not underlined except when hovered over, unless you have changed the "Underline links" settting in your Preferences, or customised your CSS. I think it would be possible for site CSS to override this and hide underlining for Chinese characters, but not convinced it would be wise. If someone has selected "Underline links: Always" we should probably respect that, especially as they may have accessibility reasons for selecting it. the wub "?!" 15:41, 3 January 2022 (UTC)[reply]
Ah! That explains it. I did not think that there would be such an option. Thanks! --Hob Gadling (talk) 15:59, 3 January 2022 (UTC)[reply]
I own a few children's and "easy reader" books in Chinese where all names are underlined. —Kusma (talk) 15:55, 3 January 2022 (UTC)[reply]
So, I am twice humbled. Thanks to you too. --Hob Gadling (talk) 16:00, 3 January 2022 (UTC)[reply]

Hidden characters in article title

Has anyone encountered this before? See this edit and the discussion here. Those same hidden characters have appeared twice at WP:FA in article names. Are they being generated when the FAC page is created, or are they coming from the actual article title, or is is something else? SandyGeorgia (Talk) 17:15, 3 January 2022 (UTC)[reply]

The character sequence \342\200\216 (octal) or \xE2\x80\x8E (hexadecimal) is the UTF8 left-to-right mark. It means that the following text reads left to right when the previous text is right to left (eg Hebrew or Arabic). It happens when you copy/paste from certain Windows applications. Unfortunately, the FACBot cannot perform this task, because unlike GA there is no indication of the classification of a featured article. Hawkeye7 (discuss) 21:07, 3 January 2022 (UTC)[reply]
It also can happen when you copy-paste from certain parts on the Wikimedia interface. A bot could strip those out of links if desired, as MediaWiki already strips U+200e, U+200f, and U+202a–U+202e from titles. Anomie 13:35, 4 January 2022 (UTC)[reply]

Watchlist only shows 29 December onwards

What's happening with the format of watchlist showing whitespace with miniscule green/black bullets, and why can't I go back further than a few days (29 Dec) when clicking on 30 from drop-down? --Rocknrollmancer (talk) 23:37, 3 January 2022 (UTC)[reply]

maybe because you hit 500 changes before you hit 30 days ? —TheDJ (talkcontribs) 10:13, 4 January 2022 (UTC)[reply]
TheDJ - it appears to be capped at 250 (emphasis as showing on watchlist page): "Below are the last 250 changes in the last 720 hours, as of 4 January 2022, 23:19". Not much use if I have a few days off (presently showing 30 Dec to 4 Jan); 2,290, must need a purge.--Rocknrollmancer (talk) 23:30, 4 January 2022 (UTC)[reply]
You can change "Maximum number of changes to show in watchlist" at Special:Preferences#mw-prefsection-watchlist. PrimeHunter (talk) 04:48, 5 January 2022 (UTC)[reply]
ThanQ, PrimeHunter, done. I noticed the 'old' watchlist format is still being used at Commons. Initially I suspected it (this new visual with excessive whitespace on en Wiki watchlist) might be a change to Firefox that I normally use, but Chrome shows the same anomaly.--Rocknrollmancer (talk) 17:41, 5 January 2022 (UTC)[reply]
@Rocknrollmancer, I wonder whether MediaWiki talk:Recentchangestext#Suggested page layout improvements is what you're dealing with. Whatamidoing (WMF) (talk) 20:34, 7 January 2022 (UTC)[reply]
Whatamidoing (WMF) - unfortunately I am completely bemused, looking at the content of the link. Comparing 'new' format with 'old' at Commons (or, at least, what I surmise En Wiki looked like before the changes) the most obvious difference is that (diff|hist) has been shifted from the left to a more-central position; ie. they are often out of line (vertically) with each other (dependent on the number of characters in the article title), so I'm constantly shifting the mouse cursor. I don't think I ever screengrabbed watchlist, so I'm uncertain. I feel I should be looking for a restore classic view option.--Rocknrollmancer (talk) 21:55, 7 January 2022 (UTC)[reply]
@Rocknrollmancer, if you look in Special:Preferences#mw-prefsection-rc do you see an item (under "Advanced options") that says something like "Group changes by page in recent changes and watchlist" or "Group results by page"? If that's got a check mark, try unchecking it and seeing whether you like the results better. Whatamidoing (WMF) (talk) 22:02, 7 January 2022 (UTC)[reply]
(Remember that you have to uncheck it and also save the changes to your preferences.) Whatamidoing (WMF) (talk) 22:03, 7 January 2022 (UTC)[reply]

Yep, Whatamidoing (WMF) - that's restored it (I unchecked the box). I've mentioned before that I intended to explore the menus, but still haven't got around to it. Thanks.--Rocknrollmancer (talk) 22:23, 7 January 2022 (UTC)[reply]

If it stays fixed, you're set. If it seems to make a habit of screwing up your prefs, then you'll want to consider installing the automagically-unbreak-my-prefs code in phab:T202916#4807046. I've been running it for three years because of this bug. Whatamidoing (WMF) (talk) 02:30, 8 January 2022 (UTC)[reply]

Help outside EnWiki - Module Rfx

Hello!

Is there someone with free extra time able to help me set up Module:Rfx for my homewiki (SqWiki)? Normally I'd just deal with the importation myself but in our community we don't use specific sections for votes. We use only 1 section for all votes, so support/oppose/neutral results are all mixed and therefore the module's code would need to be modified accordingly. Unfortunately my skills at Lua are too small to be able to overtake such a task myself. - Klein Muçi (talk) 12:33, 4 January 2022 (UTC)[reply]

Is there a way to pull in images into a table automatically from linked articles?

Hi all

I've spent the last few days compiling Flora of Malta, I think the article would be much more helpful to the reader if each plant had an image. It seems like most of the linked articles has an image. Does anyone know a way to add an images column to the tables and populate them automatically? I'd really appreciate it if you could do it, its way above my technical ability.

Thanks

John Cummings (talk) 13:04, 4 January 2022 (UTC)[reply]

I think you have more pressing issues at that page. Trying to have more than 1000 refs, the references are no longer usable and the page is added to Category:Pages where post-expand include size is exceeded. Fram (talk) 13:20, 4 January 2022 (UTC)[reply]
And as an aside, is there a way to disallow the addition of such categories directly, manually, to pages? I just had to remove it from here. Fram (talk) 13:24, 4 January 2022 (UTC)[reply]
Such a function might not do the article justice. I have done similar exercises (eg Dorman Long) and the headline image for each article is not necessarily the best one to use within a list or table; it may be unsuitable as a thumbnail, or not showing distinctive features, or not the best historical portrayal. --Verbarson talkedits 13:57, 4 January 2022 (UTC)[reply]
@Fram An edit filter to prevent it would be a good idea (I submitted a request at Wikipedia:Edit_filter/Requested#Prevent_manual_addition_of_automatic_mediawiki_categories), but in this case a redirect to that category was added inside a comment by User:Wbm1058, User:SdkbBot ran AWB genfixes which moved it outside the comment, and User:RussBot then changed the redirect to the tracking category. --Ahecht (TALK
PAGE
) 14:58, 4 January 2022 (UTC)[reply]
Thanks (both for the edit filter request, and for the explanation of what happened here). Fram (talk) 15:01, 4 January 2022 (UTC)[reply]
Manually added categories can be searched with something like: incategory:"Disambiguation pages" insource:"Category:Disambiguation pages" insource:/\[\[:?Category:Disambiguation pages\]\]/ (currently 185 hits I'm not going to check). PrimeHunter (talk) 15:12, 4 January 2022 (UTC)[reply]
Then AWB is buggy: it must not alter comments in such a way that commented-out wikicode becomes live wikicode. --Redrose64 🌹 (talk) 18:37, 4 January 2022 (UTC)[reply]
Yep; discussion on the AWB error started here. Best, {{u|Sdkb}}talk 19:58, 4 January 2022 (UTC)[reply]

Hi all

Jts1882 has suggested something super useful, which is a template which calls the Wikidata image for the topic. This is extremely helpful for very large lists of plant species eg Flora of Malta. However it doesn't scale to such large pages, its limited to around 500 images.

{{wikidata|property|raw|page=Abutilon theophrasti|P18|format=\[\[File:%p {{!}} 50px {{!}} left\]\]}}

Which makes this happen

Is there some way to auto replace this wikidata template with the normal image code e.g [[File:Example.jpg|100px]] or whatever.

Thanks

John Cummings (talk) 10:19, 5 January 2022 (UTC)[reply]

Whether it's technically possible or not, it's wrong to automate the addition of images to articles, list or otherwise. A significant proportion of images that have been linked from Wikidata items are mis-identified or now have different scientific names, at least in the English Wikipedia which is usually more up to date. Images always need reviewing. Peter coxhead (talk) 10:58, 5 January 2022 (UTC)[reply]
{{Wikidata}} works with subst.
{{subst:wikidata|property|raw|page=Abutilon theophrasti|P18|format=\[\[File:%p {{!}} 50px {{!}} left\]\]}}
saves as
[[File:Abutilon theophrasti 2006.10.11 17.01.39-pa110057.jpg {{!}} 50px {{!}} left]]
If a page is affected by template limits then you can do it on a part of the page at a time. PrimeHunter (talk) 11:00, 5 January 2022 (UTC)[reply]

Thanks so much PrimeHunter this works perfectly. Peter coxhead I will check them all manually against the images on the Wikipedia article, this will save me hours of copying and pasting. John Cummings (talk) 13:00, 5 January 2022 (UTC)[reply]

Wikidata issue

I hope this is the correct place to address this issue.

When I look at a wikidata item page, all the properties are listed. With a grey background we first have the property name, and to the right of it with a white background the property value. Behind the value the "edit" option is shown.

I work with an increased fontsize of 125% (using CTRL-+) on my screen. Most properties have a value in text format. The increased fomtsize causes some values to be wrapped over 2 or more lines. This os not a problem. However for the image property (P18) there is a problem. An image cannot be wrapped so as a result the "edit" option is moved outside the screenview. The "edit" option getting moved outside the screenview wouldn't be a problem either if a horizontal scrollbar would appear. But the scrollbar doesn't appear and therefore it It seems as if the "edit" option doesn't exist for the image property. This I consider to be a bug, not the most problematic one, but it is a problem imo. If I increase the fontsize even more (in my case to 150%) the "edit" option reappears in the top left corner of the image. When I increase even more (175%) part of the image is moved out of the screenview as well. Only at that time the horizontal scrollbar appears. However I can scroll only far enough to the right to make the full image visible but not even further to the right to see the "edit" option as well. Two additonal increases (250&), when the full image ends up outside the screenview, the "edit" option reappears again. However it's shown in front of the property name (not value). Of course, not likely someone will increase the fontsize to 250%, but I'm probably not the only one with an increase of 125%. At such an increase the "edit" option should either be visible (e.g. below the image) or it should be possible to make it visable using the horizontal scrollbar. --Sb008 (talk) 00:48, 5 January 2022 (UTC)[reply]

@Sb008: The correct place for this issue is d:WD:Contact the development team. Izno (talk) 04:00, 5 January 2022 (UTC)[reply]

Official youtube channel wikidata template?

In the external links section of the end of an article, there are a number of templates that you can use to automatically use data from wikidata, such as {{Official Website}} or {{Twitch}}. I was wondering why there was no option for this on the {{YouTube}} template. There is a option to link to a channel, but it requires that you provide a channel id. Is this purposeful? Why can't it just default to the wikidata property like the other templates of the same nature? Thanks, ― Levi_OPTalk 18:16, 5 January 2022 (UTC)[reply]

Likely because the Youtube template can be used for a variety of link types. YT Video, channel, playlist and user, all with separate Wikidata properties. As such there is a lot to interpret if you want to find the accompanying YouTube link for a page. Generally you'd probably want the channelling, but maybe not always? And which channellink, as many YT'ers have multiple channels.. But if someone were to convert the template to Lua and put some though into how to select the best appropriate YouTube related property, then there is no reason it cannot be done. —TheDJ (talkcontribs) 09:49, 6 January 2022 (UTC)[reply]
I don't know much about "converting templates" to lua, but by looking the source for the official website and twitch templates, it looks like you can just invoke {{#property}} with the name of the property and it will just return it's value. Some template editor could probably go in and make the default channel id when there is none provided {{#property:P2397}} (youtube channel id). I don't know if this is a good idea or how it works, but I'd like to be able to have some template that can do this. ― Levi_OPTalk 15:14, 6 January 2022 (UTC)[reply]

Template within a template

For some reason, {{Infobox mountain}} is giving me an error with {{native_name}} (see Mount Elbrus) even though it's formatted correctly; I'm using Safari 15.2 on Mac OS 12.1. Esszet (talk) 02:12, 7 January 2022 (UTC)[reply]

@Esszet: At a quick glance, it seems to me that {{Infobox mountain}} is not equipped to handle a list in the "native_name" parameter; it seems to want just a simple text value for the "native_name" parameter and a single IETF language tag in the "native_name_lang" parameter. DH85868993 (talk) 02:44, 7 January 2022 (UTC)[reply]
(edit conflict) If you follow the helpful links, you get to this discussion. There are currently 1,525 articles in the new Category:Native name template errors. I tried putting {{native name list}} into the infobox at Mount Elbrus, but I got the same error message. Maybe Trappist the monk, who made these changes, will be able to update the category page with clear instructions for fixing these new red error messages. – Jonesey95 (talk) 02:46, 7 January 2022 (UTC)[reply]
Thank you, and what helpful links are you talking about? Esszet (talk) 03:14, 7 January 2022 (UTC)[reply]
@Esszet: The infobox for Mount Elbrus currently displays the text: "Error: {{native name}}: an IETF language tag as parameter {{{1}}} is required (help)". If you click the word "help" it takes you to {{Native name}}. At the top of the template documentation for {{Native name}}, there is a box which says "For {{native name}} error messages appearing in various infoboxen, see Wikipedia talk:WikiProject Infoboxes § native name parameters", which is the discussion Jonesey95 referred to above. DH85868993 (talk) 05:19, 7 January 2022 (UTC)[reply]

Check if a wiki page exists in .js

Hi, I have a question about coding. Is there any way to check if a wiki page exists in user scripts, using mediawiki api? I searched a lot but couldn't figure out how. Any help would be appreciated. --Dragoniez (talk) 11:48, 7 January 2022 (UTC)[reply]

The Title object has an exists() method — see Core modules #Title and The API docGhostInTheMachine talk to me 12:22, 7 January 2022 (UTC)[reply]
@GhostInTheMachine: That seems like it, but I'm not sure why this doesn't work the way I want it to. The code adds a "test" button in the "More" list on the top of the page, and when you click it, it shows an inputbox into which you'll want to type in a wikipage name. So I need "true" back when I type in "Wikipedia:Notability" and "false" when I type in "Wikipedia:Bruhhhhhhhhhhhhhhhh" (when you run the code on enwiki), but it just returns null no matter what I type in. Do you have any ideas? --Dragoniez (talk) 13:57, 7 January 2022 (UTC)[reply]
Try giving the function a Title object? — GhostInTheMachine talk to me 14:03, 7 January 2022 (UTC)[reply]
@GhostInTheMachine: Thanks again for your reply. I'm quite new to coding and sorry still couldn't make it work. Does that mean I should give something like {Title: txt} to the exists() function as an argument? When I did so the console gave an error saying "give the function a string". --Dragoniez (talk) 15:27, 7 January 2022 (UTC)[reply]
Sorry, not near a real computer at the moment, so I can't check this myself until later. I assume that the function can take a Title object, so first step is to construct a new Title object from the name of the page as a string and then give that to the exists() function. The info implied that the exists function could also accept a page title as text, but not sure if that needs a specific format ... — GhostInTheMachine talk to me 16:24, 7 January 2022 (UTC)[reply]
It's ok, I really appreciate your help! --Dragoniez (talk) 17:46, 7 January 2022 (UTC)[reply]
Just use action=query API with the pages in titles, and the corresponding query.pages[n] objects of the response will have missing if missing (and also known if it's a file on Commons or a user page on Meta that exists). mw.Title.exist is a synchronous interface you have to implement yourself (and obviously each tab in your browser doesn't know the names of all 61,940,467 pages that exist), and I don't know why it's there (I can't find any use cases in MW core/extensions). Nardog (talk) 18:11, 7 January 2022 (UTC)[reply]
I see. I looked at the source code of mw.Title and noticed that Title.exist has the property of pages {} (an empty object). I'm guessing this means we need to define the content of the object manually when we use mw.Title.exist. Is my understanding correct? --Dragoniez (talk) 04:14, 8 January 2022 (UTC)[reply]
You don't even need to use mw.Title.exist (nobody does and I don't think you should). Just handle the response yourself, as in:
mw.loader.using('mediawiki.api', function () {
	var pages = prompt('Enter page names (separated by "|"):');
	if (!pages) return;
	new mw.Api().get({
		action: 'query',
		titles: pages, // This can be an array
		formatversion: 2
	}).done(function (response) {
		var msg = response.query.pages.map(function (page) {
			if (page.missing) {
				if (page.known) {
					return '"' + page.title + '" doesn\'t exist locally but is a blue link.';
				}
				return '"' + page.title + '" doesn\'t exist.';
			}
			return '"' + page.title + '" exists.';
		}).join('\n');
		alert(msg);
	});
});
Nardog (talk) 10:57, 8 January 2022 (UTC)[reply]
@Nardog: Thanks a lot for your help! I gave it a try in my local environment and something like the following worked just fine:
$(function(){

    $(".btn").click(function(){                             

        const apiEndpoint = "https://ja.wikipedia.org/enwiki/w/api.php?action=query&format=json&origin=*&titles=";
        const pagename = prompt("Type in a page name.");
        const url = apiEndpoint + pagename;
        $.getJSON(url, function(result){
            for (var key in result.query.pages) {
                var missing = result.query.pages[key].missing;
            }
            if (missing === undefined) {
                console.log("The page exists.");
            } else if (missing === "") {
                console.log("The page doesn't exist.");
            }            
        });        
    });
});
--Dragoniez (talk) 13:58, 8 January 2022 (UTC)[reply]
FWIW I highly recommend you use mw.Api() (or at best $.get('/enwiki/w/api.php', {...}), which mw.Api() is essentially a wrapper for). Your example won't work if the input contains e.g. an ampersand. formatversion=2 makes sure boolean-esque properties are returned as booleans rather than empty strings (which are a relic from the XML days) btw. Nardog (talk) 15:54, 8 January 2022 (UTC)[reply]

Why not use SVG files directly in Mediawiki?

Why not just use SVG files directly in Mediawiki? No messy conversions to PNG. SVG is supported very well (with few problems) in all the browsers listed here:

I looked at some of the bug trees on Phabricator concerning SVG. Seems like a lot of those problems would disappear if SVG files were used without conversion to PNG. People could code SVG images to solve browser problems, instead of Mediawiki's conversion to PNG problems.

For context see this archived discussion:

--Timeshifter (talk) 12:05, 7 January 2022 (UTC)[reply]

  1. We need protection from 20MB SVGs
  2. Font differences between clients
  3. SVG translations
  4. Someone has to put in the work to counter 1-3
TheDJ (talkcontribs) 12:06, 7 January 2022 (UTC)[reply]
TheDJ. I am not a developer, and so I am just throwing out ideas here. It sounds like to me that solving those 3 problems would be easier than the many SVG conversion to PNG problems I see in the bug trees on SVG issues on Phabricator. Am I wrong?
Maybe there could be a separate SVG permission for specific SVGs that use only certain fonts or font trees, and also met other strict Mediawiki SVG standards.
[[File:Some graphic or map.SVG|strict]]
The "strict" parameter would allow it to be posted without conversion to PNG if the Mediawiki filter determined it had already been approved for this purpose. A whitelist of approved files or something. --Timeshifter (talk) 19:42, 7 January 2022 (UTC)[reply]
Well.... its a scarcity problem. Enough users to deal with problems, but developers and their time to fix these issues (and get those fixes deployed) is scarce. Like all programming, this is a time, cost, quality tradeoff. So as long as it works 'good enough' the required investment to make a change is pretty high. —TheDJ (talkcontribs) 20:35, 7 January 2022 (UTC)[reply]

Hi all

If I have a list article with a few hundred article links in and say half of them are redlinks, is there a tool which allows you to just list the links that are red? (to create a to do list).

Thanks very much

. John Cummings (talk) 18:10, 7 January 2022 (UTC)[reply]

Each red link corresponds to a <a class="new"></a> element. You can use javascript to list all elements with "new" class. Ruslik_Zero 20:30, 7 January 2022 (UTC)[reply]
Also, I think AWB can do this. ― Qwerfjkltalk 22:19, 7 January 2022 (UTC)[reply]
Thanks Ruslik0 and Qwerfjkl, I'm not a very technical person and don't understand either of these options, what would be the easiest way to do this and where are instructions? John Cummings (talk) 00:07, 8 January 2022 (UTC)[reply]
John, is this a one-off request, or something you'll need to do repeatedly? Do you already have the list? Whatamidoing (WMF) (talk) 02:31, 8 January 2022 (UTC)[reply]
To implement Ruslik0's solution, you could open up your browser's developer tools, go to the console, and run
console.log(Array.from($('.new')).map(x => "* [[" + x.title.replace(' (page does not exist)', '') + "]]").join("\n"))
This should print out a list of the red link targets formatted as a wikitext list (i.e. if the link is [[link target|link text]], this will output [[link target]]. Vahurzpu (talk) 05:45, 8 January 2022 (UTC)[reply]
I think the shortcut is ctrl+⇧ Shift+j. ― Qwerfjkltalk 07:12, 8 January 2022 (UTC)[reply]

Automatically tag some G8-eligible pages for deletion

I occasionally tag pages to be deleted under criterion G8 (dependent on non-existent page), and I think some of this could be automated. For example, talk pages without an associated page could be tagged if they meet one of some criteria (not all should be deleted, because some are misplaced drafts). In addition to having to meet one of these criteria, the page must have only one revision (to avoid page-move vandalism etc.). Right now, I think the criteria could be:

  • every line starts with {{ or ends with }} (so it's probably all WikiProject banners and such)
  • the page is a redirect
  • the page contains one section, titled "Contested deletion", and the text in that section begins with "This page should not be speedily deleted because"

I'm going here before I file a BRFA to ensure that there's consensus for this. What do you think? Tol (talk | contribs) @ 23:43, 7 January 2022 (UTC)[reply]

Chris G used to run [[Orphaned talkpage deletion bot; here's it's BRFA. Graham87 06:08, 8 January 2022 (UTC)[reply]

Page creation log

Is there a way for the Page creation log to include a namespaces option similar to Contributions to sort out pages accordingly? 1989 (talk) 01:39, 8 January 2022 (UTC)[reply]

@1989, would Special:NewPages work for your purposes? Whatamidoing (WMF) (talk) 02:45, 8 January 2022 (UTC)[reply]
Unfortunately, no. It is limited to 30 days, similar to the New pages feed. 1989 (talk) 02:47, 8 January 2022 (UTC)[reply]

Odd behavior: Editing one part of page seems to affect unrelated part

Here's the setup.

  1. Consider this revision here.
  2. Look at the line containing the phrase "were rejected", and take note of the three bullet points.
  3. Now pick a random wikilink (e.g. someone's signature, or the link to water which I put at the bottom of the wikitext) on the page and delete it.
  4. Go back to the line containing the phrase "were rejected". Are the bullet points gone? (Edited to clarify: by gone I mean not visible. The asterisks of course still remain in the wikitext.)

Can anyone reproduce this? Deleting other things might also result in the bullet points disappearing, e.g. deleting the first template in the revision. Winston (talk) 04:55, 8 January 2022 (UTC)[reply]

@Notsniwiast: I cannot reproduce it with preview in Vector, Firefox 95.0.2, Windows 10. Such things may be caused by mismatched tags. What is your skin, browser and operating system or device? Does it happen if you log out? Please save and link a version where you don't see the bullets. PrimeHunter (talk) 11:32, 8 January 2022 (UTC)[reply]
See this diff. The revision on the left doesn't show the bullets but the right one does. I have seen this difference on both Firefox/Chrome, Windows/MacOS, and logged in/out. My skin is Legacy Vector. I believe preview doesn't show the difference I do see the difference in preview. Indeed, preview sometimes (but very rarely) doesn't match the actual edit (this might be due to a beta feature). Winston (talk) 12:29, 8 January 2022 (UTC)[reply]
Another diff here, based on a linted version from @Jonesey95. I also thought lint errors might have something to do with it, but earlier I tried cleaning them up and it didn't work either. Winston (talk) 12:33, 8 January 2022 (UTC)[reply]
I think you're trying to track down a GIGO problem. The bullets either appear or do not appear in this line:
**:*::{{yo|Nug}} I'hat[[User:atSiebert|Paul 
Siebert]] ([[User talk:atSiebert|talk]]) 00:at(UTC)
Those lines have nutty asterisk and indenting, followed by a line break in the middle of a wikilink. That's broken; don't expect it to work predictably. – Jonesey95 (talk) 15:58, 8 January 2022 (UTC)[reply]

gsdf;gksdfg

lkslkjdlfg slgjklsdgl dg