Jump to content
Toggle menu
  • 36 articles
  • 9 files
  • 1 users
  • 417 edits
Paracosm
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

This is the documentation page for Module:Dependencies

Documentation subpage

The folded Technical details panel on module and template pages: which pages use the page, what it uses, and the functions a module defines.

Module:Documentation shows it on every documented module and template, and MediaWiki:Scribunto-doc-page-does-not-exist on a module with no /doc.

For module editors

API

Each page's row lives in the dependencies table of Extension:Bucket, schema Bucket:Dependencies, generated by mise run bucket:schemas from properties.json, registered in Module:BucketQuery/manifests.json.

  • panel(options) → string: the panel followed by the page's categories, or the categories alone when the panel would be empty. Writes the page's row when the render is the page itself.
Field Type Default Meaning
page string the current page The page to describe. A /doc page describes the page it documents.
addCategories boolean or string true, except on a /doc render Whether to add the categories below.
sources list of { label, text } none A Source row above the other rows, one line per entry's text (wikitext), with each label (plain text) leading the folded header's facts. Module:Documentation passes the page's wiki-tools and Wikipedia origins.
  • main(frame): panel() for the current page, as {{#invoke:Dependencies|main}}.
  • With categories on, a template with at least one invoke joins [[Category:Lua-based templates]], a module that requires strict joins [[Category:Strict mode modules]], and a module nothing invokes, requires, or loads joins [[Category:Unused modules]].
  • The functions come from Module:Module toc.
  • Uses lists, under Files, the image files the page names: a module string that is a whole file name, a template's [[File:…]] or a parameter value that is a whole file name, and media URLs (https://media.starcitizen.tools/a/ab/<File>) in either one or in the page's own /styles.css when the page loads it. Rendered on the page itself, each file is a thumbnail in a 20px box, which records the page under the file's File usage; the /doc and sandbox renders show the name alone. Files are not stored in Bucket.

Gotchas

  • The folded header sits inside <summary>, so it holds plain text only: a link there would be followed instead of opening the panel.
  • A page writes its row only while rendering itself: never from its /doc, or a title containing /sandbox or /testcases, or starting with Sandbox/, in either namespace. Such a page is never flagged unused. A module's Used by row reads other pages' rows when the module's own page renders, so a new dependent appears after that page is next re-parsed.
  • Only literal module names are stored. A dynamic require('Module:X/' .. name) is shown as Module:X/… and stored nowhere.
  • A template that never shows {{Documentation}} writes no row, so the modules it invokes do not list it; a module whose /doc never shows it writes no row either.
  • Stylesheet pages show no panel, so a stylesheet's users are listed on the page that owns it: Module:Icon lists who loads Module:Icon/styles.css under Styles used by. Only a /styles.css subpage has an owner. Loading a module's stylesheet does not use its code: a module whose only users load its stylesheet is still unused.
  • When the Bucket lookup fails, a module's Used by row says the list is unavailable, and the module is not flagged unused.
  • A file drawn as a CSS mask, through {{filepath:}} or a stylesheet URL, records no use on the pages that show it. The Files thumbnail is the only record, made against the page whose source names the file, and it keeps the file off Special:UnusedFiles.
  • A module's file name built while the page runs shows as a pattern with no thumbnail, such as Sc-icon-brand-….svg, when string literals are joined with names, calls or indexes, or fill a string.format pattern. A pattern with nothing literal but the extension is dropped, and a name built any other way, or in a template from a parameter, is not seen.
  • A file chosen from data (API images, Bucket values) is not seen either. The page that draws it records it only when it draws a [[File:]]; drawn as a mask, nothing records it.
  • Any string that is a whole file name counts, even a sentence that happens to end in one.
  • A media URL is checked against its name. A path that is not the md5 of the name is flagged, and so is a file that has moved: [[File:]] follows the redirect, so the thumbnail still shows, but the URL no longer works. The moved check is one expensive lookup per file named by a URL.
  • A missing file shows as a red link, and MediaWiki adds the page to its hidden Category:Pages with broken file links.
  • An SVG thumbnail is a silhouette in the text colour, the way the wiki draws most icons, so a colour logo shows without its colours. A raster thumbnail keeps its own colours.