Module:Documentation/doc: Difference between revisions
MacFan4000 (talk | contribs) m 1 revision imported |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Used in system|in [[MediaWiki:Scribunto-doc-page-show]], in [[MediaWiki:Scribunto-doc-page-does-not-exist]]}} |
|||
{{High-risk}} |
|||
{{Module rating|protected}} |
{{Module rating|protected}} |
||
{{Lua|Module:Documentation/config|Module:Arguments|Module:Message box|Module:Module wikitext|Module:Protection banner}} |
|||
| ⚫ | |||
{{Uses TemplateStyles|Module:Documentation/styles.css}} |
|||
| ⚫ | |||
== Normal usage == |
== Normal usage == |
||
| Line 11: | Line 13: | ||
To use this module from another Lua module, first load it with <code>require</code>: |
To use this module from another Lua module, first load it with <code>require</code>: |
||
< |
<syntaxhighlight lang="lua"> |
||
local documentation = require('Module:Documentation').main |
local documentation = require('Module:Documentation').main |
||
</syntaxhighlight> |
|||
</source> |
|||
Then you can simply call it using a table of arguments. |
Then you can simply call it using a table of arguments. |
||
< |
<syntaxhighlight lang="lua"> |
||
documentation{content = 'Some documentation', ['link box'] = 'My custom link box'} |
documentation{content = 'Some documentation', ['link box'] = 'My custom link box'} |
||
</syntaxhighlight> |
|||
</source> |
|||
Please refer to the [[Template:Documentation/doc|template documentation]] for usage instructions and a list of parameters. |
Please refer to the [[Template:Documentation/doc|template documentation]] for usage instructions and a list of parameters. |
||
| Line 24: | Line 26: | ||
== Porting to other wikis == |
== Porting to other wikis == |
||
The module has a configuration file at [[Module:Documentation/config]] which is intended to allow easy translation and porting to other wikis. Please see the code comments in the config page for instructions. If you have any questions, or you need a feature which is not currently implemented, please leave a message at [ |
The module has a configuration file at [[Module:Documentation/config]] which is intended to allow easy translation and porting to other wikis. Please see the code comments in the config page for instructions. If you have any questions, or you need a feature which is not currently implemented, please leave a message at <span class="plainlinks">[https://en.wikipedia.org/wiki/Template_talk:Documentation Template talk:Documentation]</span><!-- this link uses external link syntax because it is intended to direct users from third-party wikis to the Wikipedia template talk page; in this situation, an internal link would unhelpfully just point to their local template talk page, and the existence of any given interwiki prefix cannot be assumed --> to get the attention of a developer. |
||
The messages that need to be customized to display a documentation template/module at the top of module pages are [[MediaWiki:Scribunto-doc-page-show]] and [[MediaWiki:Scribunto-doc-page-does-not-exist]].<noinclude> |
|||
[[Category:Module documentation pages]] |
|||
</noinclude> |
|||
Revision as of 22:24, 3 September 2024
TemplateStyles' src attribute must not be empty.
| This Lua module is used in MediaWiki:Scribunto-doc-page-show, in MediaWiki:Scribunto-doc-page-does-not-exist, and on approximately 192,000 pages. Changes to it can cause immediate changes to the Test Wiki user interface. To avoid major disruption and server load, 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. |
TemplateStyles' src attribute must not be empty.
| This module is rated as ready for general use. It has reached a mature state, is considered relatively stable and bug-free, and may be used wherever appropriate. It can be mentioned on help pages and other Wikipedia resources as an option for new users. To minimise server load and avoid disruptive output, improvements should be developed through sandbox testing rather than repeated trial-and-error editing. |
This module displays a green box containing documentation for templates, Lua modules, or other pages. The {{documentation}} template invokes it.
Normal usage
For most uses, you should use the {{documentation}} template; please see that template's page for its usage instructions and parameters.
Use in other modules
To use this module from another Lua module, first load it with require:
local documentation = require('Module:Documentation').main
Then you can simply call it using a table of arguments.
documentation{content = 'Some documentation', ['link box'] = 'My custom link box'}
Please refer to the template documentation for usage instructions and a list of parameters.
Porting to other wikis
The module has a configuration file at Module:Documentation/config which is intended to allow easy translation and porting to other wikis. Please see the code comments in the config page for instructions. If you have any questions, or you need a feature which is not currently implemented, please leave a message at Template talk:Documentation to get the attention of a developer.
The messages that need to be customized to display a documentation template/module at the top of module pages are MediaWiki:Scribunto-doc-page-show and MediaWiki:Scribunto-doc-page-does-not-exist.