انتقل إلى المحتوى

قالب:Location map/doc/Converting map definition templates to modules

من ويكيبيديا، الموسوعة الحرة

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 وحدة:Location map/data/Foobar with the same values as قالب:Location map Foobar. See قالب: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 قالب:Location map Foobar is protected, request that وحدة:Location map/data/Foobar be protected at the same level.
  3. If any pages redirect to قالب:Location map Foobar, follow the steps under the #Converting redirects heading below for each of them.
  4. If قالب:Location map Foobar/doc exists, move it to وحدة:Location map/data/Foobar/doc and convert it following the instructions under the #Converting documentation heading below.
  5. If نقاش القالب:Location map Foobar exists, move it to نقاش الوحدة:Location map/data/Foobar.
  6. Blank قالب:Location map Foobar.
  7. Move قالب:Location map Foobar to نقاش الوحدة:Location map/data/Foobar/attribution, or request this move at ويكيبيديا:RM/TR if you're unable to perform it yourself.
  8. Request that نقاش الوحدة:Location map/data/Foobar/attribution be indefinitely fully protected, since it's only being kept for its history.
  9. Add the following to the top of نقاش الوحدة:Location map/data/Foobar, or create it with this content if it doesn't exist:
    {{صندوق رسالة نقاش
    |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]].
    }}
  10. Update any links that point to قالب:Location map Foobar to point to وحدة:Location map/data/Foobar.
  11. Request that قالب:Location map Foobar be deleted under CSD G6.
  12. Request that any subpages or talk pages of قالب:Location map Foobar be deleted 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. Create وحدة:Location map/data/Foo with
    return require('Module:Location map/data/Foobar')
    
    as the content.
  2. If قالب:Location map Foo is protected, request that وحدة:Location map/data/Foo be protected at the same level.
  3. Create وحدة:Location map/data/Foo/doc as a redirect to وحدة:Location map/data/Foobar/doc.
  4. Request that قالب:Location map Foo be deleted under CSD G6.
  5. Request that any subpages or talk pages of قالب:Location map Foo be deleted 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 إسقاط متساوي المستطيلات".
  • 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 {{تحديد}} 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) ===
{{خريطة مواقع| Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
<pre style="width:25em">
{{خريطة مواقع| Sevastopol
| width   = 250
| lat_deg = 44.5
| lon_deg = 33.6
| label   = Balaklava
}}
</pre>
|see also=
* [[قالب:خريطة مواقع/شبه جزيرة القرم]]
}}
<includeonly>
<!-- Categories and interwikis go here: -->

</includeonly>