Jump to content

Help:Gadget-transclusion-check

From Wikisource

The transclusion check Gadget checks the transclusion status of each existing page appearing in an Index:'s pagelist. Pages that should be transcluded but aren't, and pages that should not be transcluded but are, get a thick red border. Every other page gets a thin green border and a subdued background color, so that the pages that need further manual checking stand out.

The Gadget adds a "Check transclusion" link to the toolbox in the left sidebar on Index: pages. To use, click this link, wait for all the data to be fetched and the pagelist to reformat, and then look for and resolve any pages marked with a thick red border. Once all these are fixed and there are no further pages with a thick red border the Index:'s transclusion status can be set to "Fully transcluded".

Note, of course, that the Gadget can't know whether a page that either does not exist or is currently "Not Proofread" or "Problematic" is one that should be transcluded. It can only check whether it is transcluded. In other words, the Gadget can help a human being to check the transclusion status of pages, but it can only check what you tell it about the page status. If the page status is misleading the Gadget will give you misleading results.

Guide to indicators

[edit]
Page status Transcluded Not transcluded Notes
Without text     Pages that are "Without text" should never be transcluded, so not being transcluded is the "normal" state for them. If they are transcluded the Gadget flags them so the problem can be fixed, typically by excluding them from the <pages … /> tag.
Not proofread     Pages that are "Not proofread" should never be transcluded, so not being transcluded is the "normal" state for them. If they are transcluded the Gadget flags them so the problem can be fixed, typically by excluding them from the <pages … /> tag or by proofreading them. Since "Not proofread" is an abnormal state such pages get a thin red border even when they are not transcluded.
Problematic     Pages that are "Problematic" should never be transcluded, so not being transcluded is the "normal" state for them. If they are transcluded the Gadget flags them so the problem can be fixed, typically by excluding them from the <pages … /> tag or by proofreading them. Since "Problematic" is an abnormal state such pages get a thin red border even when they are not transcluded.
Proofread     Pages that are "Proofread" should always be transcluded, so if they are not transcluded the Gadget flags them so the problem can be fixed. If there is some special reason why a "Proofread" page should not be transcluded (this is rare and an exception, untranscluded "Proofread" pages should always raise a flag) it can be tagged with Category:Not transcluded to indicate that this is deliberate, and the Gadget will then suppress the error indication.
Validated     Pages that are "Validated" should always be transcluded, so if they are not transcluded the Gadget flags them so the problem can be fixed. If there is some special reason why a "Validated" page should not be transcluded (this is rare and an exception, untranscluded "Validated" pages should always raise a flag) it can be tagged with Category:Not transcluded to indicate that this is deliberate, and the Gadget will then suppress the error indication.

CSS classes

[edit]

The Gadget tags each page entry in an Index:'s pagelist with classes corresponding to proprties of that page:

.transcluded The page was transcluded onto at least one page in the main namespace.
.exempt The page was a member of Category:Not transcluded so error indicators should be suppressed.
.transclusion-check Added to the top-level pagelist container. All the style rules apply to descendants of an element with this class, so other pages listed (in the ToC, for example) won't be styled. In fact, when the transclusion check styling is disabled this is done by simply removing his top-level class and leaving the classes on the individual pages in places.

Technical details

[edit]

The Gadget code lives in MediaWiki:Gadget-transclusion-check.js and depends on a stylesheet at MediaWiki:Gadget-transclusion-check.css which defines the various colors used. It works by querying the Action API for information about transcluding pages and category membership, and then setting a corresponding CSS class on the page in the pagelist. The stylesheet then has selectors that gives the default state a subdued color scheme, and then adds a bright red border (or other visually obvious styling) to any page whose combination of properties (CSS classes) indicate that it deviates from the assumptions.

Credits

[edit]

The original version of this was written by Inductiveload as a user script in 2018. Subsequently introduced bugs and misfeatures are not their fault.