User:Anne drew/FormatSeeAlso

From Wikipedia, the free encyclopedia

FormatSeeAlso automatically formats "See also" sections according to MOS:ALSO. It converts wikilinks to {{anl}} templates (adding short descriptions), formats section links with {{slink}}, and optionally sorts links alphabetically. The script preserves existing formatting like italics, quotes, and manual descriptions.

DescriptionFormats "See also" sections per MOS:ALSO – annotates links, alphabetizes, and makes other improvements.
AuthorAnne drew
UpdatedDecember 13, 2025
    (3 months ago)
Quick facts Description, Author ...
FormatSeeAlso
DescriptionFormats "See also" sections per MOS:ALSO – annotates links, alphabetizes, and makes other improvements.
AuthorAnne drew
UpdatedDecember 13, 2025
    (3 months ago)
SourceUser:Anne drew/FormatSeeAlso.js
Repositorycodeberg.org
Close

Credit to Guywan for the sorting logic from User:Guywan/Scripts/BulletSort.

SourceFeedback

Installation

  1. Go to your common JavaScript and paste: {{subst:iusc|User:Anne drew/FormatSeeAlso.js}}
  2. Save the page.

Usage

The purple "FSA" button in the editing toolbar

Edit any article with a "See also" section and click the purple "FSA" button. The script guides you through three steps:

  1. Review missing descriptions – Identify articles needing {{Short description}} templates
  2. Select redirects to annotate – Choose which redirects should use their target's description
  3. Sort lines – Optionally alphabetize per MOS:ALSO

Review your changes and save.

Example

More information Before, After ...
BeforeAfter
* [[Page with no description]]
* [[Number]]
* [[Computer science#Algorithms]]
* ''[[Animal Farm]]''
* {{anl|Animal Farm|''Animal Farm''}}
* {{slink|Computer science#Algorithms}}
* {{anl|Number}}
* [[Page with no description]]
Close

Workflow details

Step 1: Missing descriptions

Shows a dialog listing links missing descriptions so you can add them before formatting. The dialog groups items by type:

  • Articles – Direct links without short descriptions
  • Redirects to sections – Redirects pointing to sections that lack their own description
  • Redirects to articles – Redirects where both redirect and target lack descriptions

The dialog excludes red links, non-mainspace pages, disambiguation pages, links with manual descriptions, and articles with {{Short description|none}}.

Step 2: Redirect selection

For redirects where the target page has a description, you choose whether to apply that description. The script handles some cases automatically:

  • Auto-accepted: Redirects with their own description; trivial redirects (capitalization/punctuation differences only)
  • Auto-skipped: Section redirects without their own description (to avoid misleading descriptions)

Step 3: Sorting

Optional alphabetical sorting with: natural number ordering (2, 10, 100), case-insensitive comparison, quote/formatting normalization, and nested list preservation.

More information Input, Output ...
InputOutput
[[Article#Section]]{{slink|Article|Section}}
''[[Animal Farm]]''{{anl|Animal Farm|''Animal Farm''}}
"[[Article]]"{{anl|Article|quote=yes}}
[[United Nations|U.N.]]{{anl|United Nations|U.N.}}
[[United States]] (US){{anl|United States|abbr=US}}
[[Allied Commission]]s{{anl|Allied Commission|Allied Commissions}}
[[Article]], description[[Article]] – Description
Close

What the script skips

  • Disambiguation pages
  • Non-mainspace links (e.g., [[Wikipedia:MOS]])
  • Colon-prefixed links (e.g., [[:Category:Science]])
  • Links with trailing context (e.g., [[Link]] (more information...))
  • Existing templates, red links, and articles without descriptions

Related Articles

Wikiwand AI