Difference between revisions of "Module:Mapframe/doc"
Jump to navigation
Jump to search
blackwiki>Evad37 (→Usage: in main template now, not just sandbox) |
m (8 revisions imported) |
||
| (5 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
{{Module rating |beta}} | {{Module rating |beta}} | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
| + | On English Wikipedia, this module is called by {{tlx|Maplink}}, see that template's documentation for usage instructions. | ||
== Usage == | == Usage == | ||
| − | + | ;Standard usage: | |
| + | :Just use {{tl|Maplink}}, which passes its parameters to this module's {{mono|main}} function. | ||
| + | ;From another module: | ||
| + | :# Import this module, e.g. <code><nowiki>local mf = require('Module:Mapframe')</nowiki></code> | ||
| + | :# Pass a table of parameter names/values to the {{mono|_main}} function. See {{tl|Maplink}} documentation for parameter names and descriptions. E.g. <code><nowiki>local mapframe = mf._main(parameters)</nowiki></code> | ||
| + | :# Preprocess {{mono|_main}}'s output before returning it, e.g. <code><nowiki>return frame:preprocess(mapframe)</nowiki></code> | ||
== Set up on another wiki == | == Set up on another wiki == | ||
# '''Create template and module:''' | # '''Create template and module:''' | ||
#* Import this module and its template to that wiki (or copy the code over, giving attribution in the edit summary). Optionally, give them a name that makes sense in that wiki's language | #* Import this module and its template to that wiki (or copy the code over, giving attribution in the edit summary). Optionally, give them a name that makes sense in that wiki's language | ||
| − | #* On Wikidata, add them to the items | + | #* On Wikidata, add them to the items [[d:Q52554979|Q52554979]] and [[d:Q27882107|Q27882107]] |
# '''Localise the module''' | # '''Localise the module''' | ||
#* Edit the top bits of the module, between the comments <code>-- ##### Localisation (L10n) settings #####</code> and <code>-- #### End of L10n settings ####</code>, replacing values between <code>"</code> <code>"</code> symbols with local values (when necessary) | #* Edit the top bits of the module, between the comments <code>-- ##### Localisation (L10n) settings #####</code> and <code>-- #### End of L10n settings ####</code>, replacing values between <code>"</code> <code>"</code> symbols with local values (when necessary) | ||
Latest revision as of 07:54, 27 September 2020
| 40x40px | This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
On English Wikipedia, this module is called by {{Maplink}}, see that template's documentation for usage instructions.
Usage
- Standard usage
- Just use {{Maplink}}, which passes its parameters to this module's main function.
- From another module
-
- Import this module, e.g.
local mf = require('Module:Mapframe') - Pass a table of parameter names/values to the _main function. See {{Maplink}} documentation for parameter names and descriptions. E.g.
local mapframe = mf._main(parameters) - Preprocess _main's output before returning it, e.g.
return frame:preprocess(mapframe)
- Import this module, e.g.
Set up on another wiki
- Create template and module:
- Localise the module
- Edit the top bits of the module, between the comments
-- ##### Localisation (L10n) settings #####and-- #### End of L10n settings ####, replacing values between""symbols with local values (when necessary)
- Edit the top bits of the module, between the comments
- Add documentation
- to the template (e.g. by translating Template:Maplink/doc, adjusting as necessary per any localisations made in the previous step)
- to the module (please transfer/translate these instructions so that wikimedians who read your wiki but not the English Wikipedia can also set up the module and template on another wiki).