Difference between revisions of "Template:Location map/doc/Converting map definition templates to modules"

From blackwiki
Jump to navigation Jump to search
imported>Jackmcbarn
(explain how to convert x,y)
imported>Jonesey95
m (Fix Linter errors using AutoEd)
 
(3 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
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".
 
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".
 
#Create [[Module:Location map/data/Foobar]] with the same values as [[Template:Location map Foobar]]. See [[Template: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 <nowiki>{{{2}}} or {{{2|}}}</nowiki> need to be changed to $1, and all occurrences of <nowiki>{{{3}}} or {{{3|}}}</nowiki> need to be changed to $2.
 
#Create [[Module:Location map/data/Foobar]] with the same values as [[Template:Location map Foobar]]. See [[Template: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 <nowiki>{{{2}}} or {{{2|}}}</nowiki> need to be changed to $1, and all occurrences of <nowiki>{{{3}}} or {{{3|}}}</nowiki> need to be changed to $2.
#If [[Template:Location map Foobar]] is protected, request that [[Module:Location map/data/Foobar]] be protected at the same level.
+
#If [[Template:Location map Foobar]] is protected, protect or request protection of [[Module:Location map/data/Foobar]] at the same level.
 
#If any pages redirect to [[Template:Location map Foobar]], follow the steps under the [[#Converting redirects]] heading below for each of them.
 
#If any pages redirect to [[Template:Location map Foobar]], follow the steps under the [[#Converting redirects]] heading below for each of them.
#If [[Template:Location map Foobar/doc]] exists, move it to [[Module:Location map/data/Foobar/doc]] and convert it following the instructions under the [[#Converting documentation]] heading below.
+
#If [[Template:Location map Foobar/doc]] exists, move it to [[Module:Location map/data/Foobar/doc]] (without leaving a redirect if possible) and convert it following the instructions under the [[#Converting documentation]] heading below.
#If [[Template talk:Location map Foobar]] exists, move it to [[Module talk:Location map/data/Foobar]].
+
#If [[Template talk:Location map Foobar]] exists, move it to [[Module talk:Location map/data/Foobar]] (without leaving a redirect if possible).
 
#Blank [[Template:Location map Foobar]].
 
#Blank [[Template:Location map Foobar]].
#Move [[Template:Location map Foobar]] to [[Module talk:Location map/data/Foobar/attribution]], or request this move at [[WP:RM/TR]] if you're unable to perform it yourself.
+
#Move [[Template: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.
#Request that [[Module talk:Location map/data/Foobar/attribution]] be indefinitely fully protected, since it's only being kept for its history.
+
#Fully protect or request full protection of [[Module talk:Location map/data/Foobar/attribution]] indefinitely, since it's only being kept for its history.
 
#Add the following to the top of [[Module talk:Location map/data/Foobar]], or create it with this content if it doesn't exist:{{#tag:pre|<nowiki>{{tmbox
 
#Add the following to the top of [[Module talk:Location map/data/Foobar]], or create it with this content if it doesn't exist:{{#tag:pre|<nowiki>{{tmbox
 
|type=notice
 
|type=notice
|text=Revision history for the template that was converted to [[Module:Location map/data/Foobar]] can be found at [[Module talk:Location map/data/Foobar/attribution]].
+
|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].
 
}}</nowiki>}}
 
}}</nowiki>}}
 
#Update any links that point to [[Template:Location map Foobar]] to point to [[Module:Location map/data/Foobar]].
 
#Update any links that point to [[Template:Location map Foobar]] to point to [[Module:Location map/data/Foobar]].
#Request that [[Template:Location map Foobar]] be deleted under CSD G6.
+
#Delete or request deletion of [[Template:Location map Foobar]] under CSD G6.
#Request that any subpages or talk pages of [[Template:Location map Foobar]] be deleted under CSD G8.
+
#Delete or request deletion of subpages or talk pages of [[Template:Location map Foobar]] under CSD G8.
  
 
== Converting redirects ==
 
== Converting redirects ==
 
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".
 
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".
 +
#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.
 
#Create [[Module:Location map/data/Foo]] with <syntaxhighlight lang="lua">return require('Module:Location map/data/Foobar')</syntaxhighlight> as the content.
 
#Create [[Module:Location map/data/Foo]] with <syntaxhighlight lang="lua">return require('Module:Location map/data/Foobar')</syntaxhighlight> as the content.
#If [[Template:Location map Foo]] is protected, request that [[Module:Location map/data/Foo]] be protected at the same level.
+
#If [[Template:Location map Foo]] is protected, protect or request protection of [[Module:Location map/data/Foo]] at the same level.
 
#Create [[Module:Location map/data/Foo/doc]] as a redirect to [[Module:Location map/data/Foobar/doc]].
 
#Create [[Module:Location map/data/Foo/doc]] as a redirect to [[Module:Location map/data/Foobar/doc]].
#Request that [[Template:Location map Foo]] be deleted under CSD G6.
+
#Delete or request deletion of [[Template:Location map Foo]] under CSD G6.
#Request that any subpages or talk pages of [[Template:Location map Foo]] be deleted under CSD G8.
+
#Delete or request deletion of any subpages or talk pages of [[Template:Location map Foo]] under CSD G8.
  
 
== Converting documentation ==
 
== Converting documentation ==
 
Replace the documentation page, except for comments, categories, etc. with a transclusion of [[Module:Location map/data/doc]]. To match the appearance of the old doc page, the following parameters are accepted:
 
Replace the documentation page, except for comments, categories, etc. with a transclusion of [[Module:Location map/data/doc]]. To match the appearance of the old doc page, the following parameters are accepted:
*<tt>image</tt> - the image displayed to the right of the introductory text. If omitted, no image is displayed.
+
*<code>image</code> - the image displayed to the right of the introductory text. If omitted, no image is displayed.
*<tt>projection</tt> - the type of projection the map uses. If omitted, defaults to "an [[equirectangular projection]]".
+
*<code>projection</code> - the type of projection the map uses. If omitted, defaults to "an [[equirectangular projection]]".
*<tt>name</tt> - the name to use in the introductory text. If omitted, defaults to the name specified in the map definition.
+
*<code>name</code> - the name to use in the introductory text. If omitted, defaults to the name specified in the map definition.
*<tt>examples</tt> - the contents of the Examples section. The Examples header itself and the final {{tl|clear}} template are not required. If omitted, no examples section is displayed.
+
*<code>examples</code> - the contents of the Examples section. The Examples header itself and the final {{tl|clear}} template are not required. If omitted, no examples section is displayed.
*<tt>see also</tt> - additional links to display at the top of the See also section. If omitted, no additional links are displayed.
+
*<code>see also</code> - 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:Location map/data/doc]] does not support, please add support for them.
 
If any features are present in the old doc page that [[Module:Location map/data/doc]] does not support, please add support for them.
  

Latest revision as of 19:14, 4 June 2020

Converting definitions

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:Location map/data/Foobar with the same values as Template:Location map Foobar. See Template: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:Location map Foobar is protected, protect or request protection of Module:Location map/data/Foobar at the same level.
  3. If any pages redirect to Template:Location map Foobar, follow the steps under the #Converting redirects heading below for each of them.
  4. If Template:Location map Foobar/doc exists, move it to Module: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:Location map Foobar.
  7. Move Template: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:
    {{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:Location map Foobar to point to Module:Location map/data/Foobar.
  11. Delete or request deletion of Template:Location map Foobar under CSD G6.
  12. Delete or request deletion of subpages or talk pages of Template:Location map Foobar under CSD G8.

Converting redirects

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:Location map/data/Foo with
    return require('Module:Location map/data/Foobar')
    
    as the content.
  3. If Template:Location map Foo is protected, protect or request protection of Module:Location map/data/Foo at the same level.
  4. Create Module:Location map/data/Foo/doc as a redirect to Module:Location map/data/Foobar/doc.
  5. Delete or request deletion of Template:Location map Foo under CSD G6.
  6. Delete or request deletion of any subpages or talk pages of Template:Location map Foo under CSD G8.

Converting documentation

Replace the documentation page, except for comments, categories, etc. with a transclusion of Module: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: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:Location map/data/doc|image=<!-- [[File:|thumb|300px|Map of Sevastopol]] -->
|examples=
=== Location map, using default map (image) ===
{{Location map | Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
<pre style="width:25em">
{{Location map | Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
</pre>
|see also=
* [[Template:Location map Crimea]]
}}
<includeonly>
<!-- Categories and interwikis go here: -->

</includeonly>