User:GhostInTheMachine/SDlinkBuilder

Purpose
This script helps you to create a Wikipedia page that is a list of pages with their current short descriptions.

The script does not alter any article at all. It just creates wiki text for you. To "work", you have to paste this wiki text into a page somewhere.

Use
This script may be used on any page in any name space.

It collects all of the wiki links from the current page, filters out links to some of the namespaces and then displays wiki text for a sorted list of the remaining links.

The wiki text may then be pasted into a sandbox page or just viewed as a preview in the page editor.

Each link is wrapped in a template that outputs the current short description of the article in the link.

This makes it easy to spot articles with no short description.

By building this list from a category page, the script also helps to spot any articles where the short description does not follow the same pattern as the rest of the articles in the category.

Just work down the list and open each incorrect article in a new tab ...

For examples of the pages created, see my SD work pages: SD SD2 SD3 SD4

Prerequisites
None.

Installing
Add the following line to your common.js file.

Depending on which skin is configured, this will add an extra tab or an extra menu item.
 * Vector adds "SDlinks" option to the "More" menu
 * Modern / Monobook adds "sdlinks" tab after the "history" and "watch" tabs
 * Timeless adds "SDlinks" options to the Page tools menu
 * MinervaNeue does not add the SDlinks option at all

If you do not see the new option, then refresh the page. If that fails – flush the browser cache.

Alternatives
I wrote this script partly as a learning exercise in writing a user script. It works and does what it says on the tin, but there are, of course, alternative tools for assisting with short descriptions.

Fork
Hi! I forked this script at User:Qwerfjkl/scripts/getLinks, but it's annoying to copy on mobile, so I added some code to add a copy button. I just thought I'd notify you in case you wanted to add this to your own script. In any case, happy editing! &#8213; Qwerfjkl  talk  22:42, 22 January 2022 (UTC)

Possible improvements

 * Create the list in a blank new window, so that the original page is not disturbed
 * Add a Save option to write the list to a specific user sub-page
 * Filter the list to remove articles that are known to not need a SD
 * Add Infobox Wikipedia user script?