Template:Wp/kjp/Location map/doc/Converting map definition templates to modules

Converting definitionsEdit

This checklist lists the steps required to convert a location map definition from a template to a module. In this example, the definition will be called "Foobar".

  1. Create Module:Wp/kjp/Location map/data/Foobar with the same values as Template:Location map Foobar. See Template:Wp/kjp/Location map/Creating a new map definition for more details on this step. Note that if a map contains formulas for x and/or y, all occurrences of {{{2}}} or {{{2|}}} need to be changed to $1, and all occurrences of {{{3}}} or {{{3|}}} need to be changed to $2.
  2. If Template:Wp/kjp/Location map Foobar is protected, protect or request protection of Module:Wp/kjp/Location map/data/Foobar at the same level.
  3. If any pages redirect to Template:Wp/kjp/Location map Foobar, follow the steps under the #Converting redirects heading below for each of them.
  4. If Template:Wp/kjp/Location map Foobar/doc exists, move it to Module:Wp/kjp/Location map/data/Foobar/doc (without leaving a redirect if possible) and convert it following the instructions under the #Converting documentation heading below.
  5. If Template talk:Location map Foobar exists, move it to Module talk:Location map/data/Foobar (without leaving a redirect if possible).
  6. Blank Template:Wp/kjp/Location map Foobar.
  7. Move Template:Wp/kjp/Location map Foobar to Module talk:Location map/data/Foobar/attribution (without leaving a redirect if possible), or request this move at WP:RM/TR if you're unable to perform it yourself.
  8. Fully protect or request full protection of Module talk:Location map/data/Foobar/attribution indefinitely, since it's only being kept for its history.
  9. Add the following to the top of Module talk:Location map/data/Foobar, or create it with this content if it doesn't exist:
    {{Wp/kjp/Tmbox
    |type=notice
    |text=Revision history for the template that was converted to [[Module:{{PAGENAME}}]] can be found at [{{fullurl:{{FULLPAGENAME}}/attribution|action=history}} {{FULLPAGENAME}}/attribution: Revision history].
    }}
  10. Update any links that point to Template:Wp/kjp/Location map Foobar to point to Module:Wp/kjp/Location map/data/Foobar.
  11. Delete or request deletion of Template:Wp/kjp/Location map Foobar under CSD G6.
  12. Delete or request deletion of subpages or talk pages of Template:Wp/kjp/Location map Foobar under CSD G8.

Converting redirectsEdit

This checklist lists the steps required to convert a redirect to a location map definition from a template to a module. In this example, the redirect will be called "Foo" and will point to "Foobar".

  1. Check if any pages use the redirect. If not, skip the rest of the steps and just request it be deleted under CSD G8 once the page it redirects to gets converted.
  2. Create Module:Wp/kjp/Location map/data/Foo with
    return require('Module:Wp/kjp/Location map/data/Foobar')
    
    as the content.
  3. If Template:Wp/kjp/Location map Foo is protected, protect or request protection of Module:Wp/kjp/Location map/data/Foo at the same level.
  4. Create Module:Wp/kjp/Location map/data/Foo/doc as a redirect to Module:Wp/kjp/Location map/data/Foobar/doc.
  5. Delete or request deletion of Template:Wp/kjp/Location map Foo under CSD G6.
  6. Delete or request deletion of any subpages or talk pages of Template:Wp/kjp/Location map Foo under CSD G8.

Converting documentationEdit

Replace the documentation page, except for comments, categories, etc. with a transclusion of Module:Wp/kjp/Location map/data/doc. To match the appearance of the old doc page, the following parameters are accepted:

  • image - the image displayed to the right of the introductory text. If omitted, no image is displayed.
  • projection - the type of projection the map uses. If omitted, defaults to "an equirectangular projection".
  • name - the name to use in the introductory text. If omitted, defaults to the name specified in the map definition.
  • examples - the contents of the Examples section. The Examples header itself and the final {{clear}} template are not required. If omitted, no examples section is displayed.
  • see also - additional links to display at the top of the See also section. If omitted, no additional links are displayed.

If any features are present in the old doc page that Module:Wp/kjp/Location map/data/doc does not support, please add support for them.

Here is an example of a converted doc page:

<!-- Categories and interwikis go at the bottom of this page. -->
{{Module:Wp/kjp/Location map/data/doc|image=<!-- [[File:|thumb|300px|Map of Sevastopol]] -->
|examples=
=== Location map, using default map (image) ===
{{Wp/kjp/Location map | Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
<pre style="width:25em">
{{Wp/kjp/Location map | Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
</pre>
|see also=
* [[Template:Wp/kjp/Location map Crimea]]
}}
<includeonly>
<!-- Categories and interwikis go here: -->

</includeonly>
https://incubator.m.wikimedia.org/wiki/Template:Wp/kjp/Location_map/doc/Converting_map_definition_templates_to_modules
incubator.m.wikimedia.org
crawl=CC-MAIN-2022-33
33137
application/http; msgtype=response
sha1:E6PPD5I34BKTICRS46MZ6GAD4YDWCW3Z
<urn:uuid:163a6ff1-2dc7-4eb1-8e60-cc6495d1be25>
2022-08-15T10:28:37Z
208.80.154.224
text/html
sha1:HFGYAZNOXI6VSAVCWE4QHOVETET4ACLP
<urn:uuid:d20c3525-9b31-4d6a-a824-0b74ea595c7f>
https://incubator.m.wikimedia.org/wiki/Template:Wp/kjp/Location_map/doc/Converting_map_definition_templates_to_modules
response
<urn:uuid:4f341650-799c-45b0-82e5-036ab661c143>
isPartOf: CC-MAIN-2022-33
publisher: Common Crawl
description: Wide crawl of the web for August 2022
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-222
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/