Module:Subject page header/doc
Appearance
| This is a documentation subpage for Module:Subject page header. It may contain usage information, categories and other content that is not part of the original module page. |
| This Lua module is used in system messages. Changes to it can cause immediate changes to the Wikipedia user interface. To avoid major disruption, any changes should be tested in the module's /sandbox or /testcases subpages, or in your own module sandbox. The tested changes can be added to this page in a single edit. Please discuss changes on the talk page before implementing them. |
This module is used from the interface message MediaWiki:Subjectpageheader, shown at the top of all non-talk pages.
The interface message is parsed on every page view. There is no caching (although for logged-out users Varnish caches the entire HTML before it even reaches MediaWiki). So, please ensure this module runs as fast as possible. Some tips:
- Avoid unconditional imports of other modules. Instead, import them inside conditional blocks where they are needed.
- Avoid unconditionally performing expensive lookups. For example, to check if a page is JSON, first check if the page name suffix is
.json(which is very fast) and only then look up the content model.
Usage
[edit]{{#invoke:Subject page header|main}}