Template:WikiProject Korea

From Wikipedia, the free encyclopedia

Map of Korea WikiProject Korea invites you to join in improving Wikipedia articles related to Korea.
This template employs intricate features of template syntax.
Please do not alter it unless you are certain to understand its setup and parser functions and are ready to repair/revert all collateral damage if results are unexpected.
Any experiments should be conducted and all improvements tested in either the template sandbox or your user space before applying anything here.
The template documentation below is transcluded from Template:WikiProject Korea/doc [edit]

This template is used to mark an article as part of as part of WikiProject Korea. This should be placed in the talk pages of articles related to Korea. It may also include an article assessment, and the related working group within WIkiProject Korea may be mentioned.

Contents

[edit] Usage

Place {{korean}} on the article's talk page. It is also possible to indicate an assessment of the article by including importance and quality as unnamed parameters. For example, a start quality, low priority article can be marked with {{korean|C|4}}.

It is also possible to indicate the WikiProject Korea working group associated with the article. For example, {{korean|B|high|hist}} marks a B-class quality, high priority article associated with the history working group. To get a small message box, include small=yes as an option, as in {{korean|B|high|small=yes}}.

There are actually two ways to specify options with the template. One is to use unnamed parameters as shown previously. Either both the assessment and importance must be specified, or all three of assessment, importance, and working group must be specified together. The order by which the options are listed is fixed as in the following:

  {{korean | class | importance}}
  {{korean | class | importance | wg}}

An alternative way to specify options with the template is to use named parameters. Named parameters are specified by the parameter name, an equal sign, and the parameter value. For example, importance=medium denotes a medium importance. Named parameters are flexible in that the options may be specified in any order and unnecessary options may simply be omitted, unlike with unnamed parameters where the first parameter must be specified in order to specify the second parameter, etc.

The available options for the template are:

class 
The quality of the article. Quality parameters are automatically transformed into a canonical form for consistency. For example, "C" is automatically transformed to "Start".
importance 
The importance of the article. Importance parameters are also automatically transformed into a canonical form. For example, "1" is tranformed to "Top".
wg 
The working group associated with the article. Each working group is specified with a tag.
small 
A value of yes specifies the use of a small message box.
Quality parameters
Canonical Equivalents
FA Featured
A-class A
B-class B
Start C-class, C
D-class D
Stub E-class, E
Unstable U
Tool[1] T
Project[2] P
Importance parameters
Canonical Equivalents
Top 1, 1st, 1st-rank
High 2, 2nd, 2nd-rank, hi
Medium 3, 3rd, 3rd-rank, mid
Low 4, 4th, 4th-rank, lo
Very low 5, 5th, 5th-rank, vlo
Working groups
Group Tags
DPRK dprk, north korea
South Korean geography skgeo, skcc, south korean geography
Military history milhist, military history
History hist, history
Cuisine food, cuisine
Popular culture pop, popcult, popculture, popular culture

[edit] Examples

Using {{korean|C|4}} to mark a stub quality, high priority article produces:

Map of Korea WikiProject Korea invites you to join in improving Wikipedia articles related to Korea. Pavilion at Gyeongbok palace, Seoul

Using {{korean|importance=high|wg=history}} to mark a high priority article associated with the history working group produces:

Map of Korea WikiProject Korea invites you to join in improving Wikipedia articles related to Korea. Pavilion at Gyeongbok palace, Seoul
Map of Korea This is part of WikiProject Korea. Pavilion at Gyeongbok palace, Seoul

Using {{korean|class=T|small=yes}} to mark a Wikipedia tool produces a small message box as a sidebar.

[edit] Implementation details

/Source is a version of this template with no template substitution applied. The main template is obtained by copying from this template and manually substituting templates to decrease transclusion overhead. Actual maintenance and development is done on the unsubstituted version, which is much easier to do than maintaining the fully substituted version.

The substitution procedure:

  1. Copy and paste wikicode from /Output to /SubstOutput
  2. Substitute templates in /SubstOutput for the templates /WG, /CatClass, /CatImp using subst:
  3. Copy and paste the wikicode from /Source to Template:WikiProject Korea between <nowiki>
  4. Substitute templates in Template:WikiProject Korea for template /SubstOutput using subst:
  5. Put <includeonly> around the two parts which categorize articles without assessment or with unknown importance

This template is created from the following "source" templates:

  • /Source is the top-level template
  • /Output actually generates message box
  • /WG outputs working group bullet
  • /CatClass categorizes by class
  • /CatImp categorizes by importance

Things to do:

  • Optimize transclusion size. (Variables would have made this really easy.)
  • Automatic template substitution.

[edit] Notes

  1. ^ Marks tools supporting Wikipedia.
  2. ^ Marks a Wikipedia project page.