도움말:Magic words

From mediawiki.org
This page is a translated version of the page Help:Magic words and the translation is 50% complete.
Outdated translations are marked like this.
PD 주의사항: 이 문서를 편집하면 CC0에 따라 당신의 기여한 것을 배포하는 데 동의하는 것으로 간주됩니다. 자세한 내용은 퍼블릭 도메인 도움말 문서를 확인 하세요. PD

매직 워드(Magic words) 또는 특수 명령문은 미디어위키에서 시간, 사이트의 정보 혹은 문서의 이름 등 정해진 값, 문자열 혹은 함수를 출력하는데 사용하는 문자열입니다. 이 문서는 미디어위키에서 기본적으로 제공하는 특수 명령문에 대해서만 설명하고 있습니다. 기술적인 참고 사항에 대해서는 Manual:Magic words 를 보시기 바랍니다.

특수 명령문에는 크게 세 가지 종류가 있습니다.

  • 작동 스위치: 두 개의 밑줄표로 둘러싸이고 대문자로 된 문자열을 가지는 경우가 보통입니다. 예시: __FOO__

변수와 파서 함수는 틀과 마찬가지로 "풀기:" 혹은 "subst:"를 이용해서 풀어쓴 형태로 나타낼 수도 있습니다. 문서에 의존적인 특수 명령어들은(예시:PAGEID 등)은 명령어들이 본문이 아닌 문서에 인용된 틀이나 시스템 메시지를 통해서 삽입되었을지라도 "현재 문서"에 관련된 값을 출력합니다.

작동 스위치

작동 스위치는 (스킨이 지원하는 경우) 문서의 레이아웃이나 작동을 제어하고 내용을 원하는 대로 넣거나 빼는 데 사용할 수 있습니다. 특히 아래의 것들 중 일부는 미네르바 노이에 스킨에서 지원하지 않습니다.

문자열 설명 버전
목차
__NOTOC__ 목차(TOC)를 숨깁니다.
__FORCETOC__ 목차가 항상 보이도록 설정합니다. (__NOTOC__보다 우선시됩니다.) This will not work in skins that present table of contents outside the article content e.g. Vector 2022 skin.
__TOC__ 문자열이 입력된 곳에 목차를 표시합니다. (만약 __NOTOC__가 사용되었다면 NOTOC을 무시합니다.) 여러 번 사용된 경우는 첫 번째만 작동합니다. This will not work in skins that present table of contents outside the article content e.g. Vector 2022 skin.
편집
__NOEDITSECTION__ 소제목에 붙는 '편집' 링크를 숨깁니다. 틀 안에서 이 명령어를 사용할 경우 이 틀을 모두 포함하는 문서와 해당 문서에 한해 이 문서에서 인용된 틀 전체에 영향을 줍니다. 어떻게 작동하는지 확인하려면 이곳을 확인하십시오.
__NEWSECTIONLINK__ 토론 문서가 아닌 경우, 문서 메뉴에 ‘편집’ 탭 옆에 새 토론 추가하기를 추가합니다. (이름은 Adding a section to the end에서 지정할 수 있습니다.)
1.7
__NONEWSECTIONLINK__ 토론 문서에서 "편집" 탭 옆의 새 토론 추가 링크를 제거합니다.
1.15
r47522
분류
__NOGALLERY__ 분류 문서에서 사용합니다. 그림 파일이 섬네일로 나오지 않고, 대신 일반 문서로 나옵니다.
1.7
__HIDDENCAT__ 분류 문서에서 사용합니다. 해당 분류에 속하는 문서가 자신이 그 분류에 속한다는 것을 표시하지 않습니다. (해당 분류를 보려면 사용자 설정에서 바꿀 수 있습니다.)
1.13
__EXPECTUNUSEDCATEGORY__ 분류 문서에서 사용하면 특수:사용하지 않는 분류 목록에서 분류가 제거됩니다.
1.33
언어 변환
__NOCONTENTCONVERT__
__NOCC__
언어 표현을 변경할 수 있는 경우에 사용합니다. 문서를 표시할 때 언어 변환을 사용하지 않습니다. 예를 들어, 중국어 문서(zh)를 zh_cn, zh_tw, zh_sg, zh_hk로 변환하지 않습니다.
__NOTITLECONVERT__
__NOTC__
__NOCONTENTCONVERT__와 비슷하지만, 제목에만 변환을 사용하지 않습니다. 나머지 내용은 변환합니다.
기타
__START__ 작동하지 않습니다. Was used to point where database message starts after comment that should not be transcluded. r1695 에서 제거되었으며, r24784 에서 완전히 제거되었습니다.
1.10
r1610
__END__ 미디어위키가 문서 끝에 공백으로

나타나는 것을 회피하기 위해서 끝에 명시적으로 표시를 합니다. 19213에서 제거되었습니다.

1.1 – 1.8
__INDEX__ 검색엔진이 이 문서를 수집하는 것을 허가합니다. ($wgArticleRobotPolicies 을 오버라이드하지만, robots.txt를 오버라이드하지 않습니다.) 변수 $wgExemptFromUserRobotsControl 값에 따릅니다.
1.14
__NOINDEX__ 검색엔진이 이 문서를 수집하는 것을 거부합니다. It obeys $wgExemptFromUserRobotsControl variable.
1.14
r37973
__STATICREDIRECT__ 넘겨주기 문서에서 사용합니다. 누군가 문서를 이동하고 나서 "원래 제목을 가리키는 넘겨주기를 새로 고침"를 확인할 때, 미디어위키가 자동으로 넘겨주기 링크를 갱신하지 않습니다 (요구 변수는 $wgFixDoubleRedirects ).
1.13
r37928
확장 기능
확장 기능 문자열 설명 버전
GlobalUserPage __NOGLOBAL__ 전역 사용자 문서를 비활성화 합니다. If present on the central user page, will prevent it from being displayed on remote wikis, and it also determines whether a link to a user page on remote wiki should be red or blue.
1.28
Disambiguator __DISAMBIG__ 동음이의어 문서로 지정합니다.
1.21
Wikibase __EXPECTED_UNCONNECTED_PAGE__ 위키 문서 중에는 토론의 과거 로그나 틀의 하위문서 등 위키데이터의 항목에 적합아지 않습니다. 위키 문서가 Special:UnconnectedPages 에 등록되는 것을 피하려면 문서의 어딘가에 이 마크업을 사용해주세요. Wikidata's notability criteria를 충족하지 않은 문서는 위키데이터 항목을 얻어서는 안됩니다.
1.37.0-wmf.14
DiscussionTools __ARCHIVEDTALK__ Hides "답변" links from discussions on archived pages.
1.39
Gerrit change 738221
__NOTALK__ Makes a page in a talk namespace not be treated like a talk page.
1.39
Gerrit change 903247

변수

변수는 현재의 문서와 위키, 날짜의 정보를 표시합니다. 변수의 사용은 과 비슷합니다. "[과부하]"표시가 있는 변수(의 사용)는 소프트웨어가 추적하며 문서 내에서 사용할 수 있는 횟수에는 제한이 있습니다.

틀과 변수의 이름이 같을 경우에는 변수가 사용됩니다(불러들일 틀인 Template:PAGENAME에 $codePAGENAME$code-end 를 기입할 필요가 있습니다). 경우에 따라서는 매개변수 추가로 틀을 호출하기 위해서 파서가 강제됩니다. 예를 들면, $tpl-currentdayname-code 는 변수가 아닌 $tpl-currentdayname-result 를 불러들입니다. In some cases, adding parameters will force the parser to invoke a template; for example, {{CURRENTDAYNAME|x}} transcludes Template:CURRENTDAYNAME, not the variable.

날짜 및 시간

다음 변수는 현재 날짜와 시간을 UTC로 반환합니다.

미디어위키 및 브라우저 캐싱으로 인해서 이들의 변수는 현재의 날짜가 아닌 문서가 캐싱된 날짜와 시간을 표시합니다.

이들의 변수를 사용하면 문서가 보다 제한된 초 사이가 캐싱됩니다. 이는 MagicWordFactory에서 구성됩니다.

날짜와 시간의 특수 명령문은 위키 컨텐츠의 언어의 포맷으로 표시됩니다. 1.19 이후로는 문서 컨텐츠의 언어에 의존합니다.

변수 출력 설명 버전
연도
{{CURRENTYEAR}} 2024 연도
{{CURRENTMONTH}}

{{CURRENTMONTH2}}

03 달(01~12의 두 자리 숫자로 표시)
{{CURRENTMONTH1}} 3 달(1~9는 한 자리, 10~12는 두 자리의 숫자로 표시)
{{CURRENTMONTHNAME}} 3월 달(이름으로 표시)
{{CURRENTMONTHNAMEGEN}} 3월 달(소유격. 언어에 따라 소유격이 다른 경우에 사용합니다)
{{CURRENTMONTHABBREV}} 3 달(약어 표기)
1.5
날짜
{{CURRENTDAY}} 19 월별 날짜(1~31로 표기)
{{CURRENTDAY2}} 19 월별 날짜(01~31로 표기)
1.6
{{CURRENTDOW}} 2 요일(숫자, 월=1, 화=2, ..., 일=7)
{{CURRENTDAYNAME}} 화요일 요일(이름)
시간
{{CURRENTTIME}} 08:11 시간(24시간 HH:mm)
{{CURRENTHOUR}} 08 시간(분 없이, HH(00~24)로 표기)
기타
{{CURRENTWEEK}} 12 주(숫자, 한 해에서 몇 번째 주인지를 표시)
{{CURRENTTIMESTAMP}} 20240319081131 YYYYMMDDHHmmss
1.7
{{CURRENTDATE}} 은 특수 명령문이 아닌 일 겁니다.

아래의 변수는 위와 같이 실행하지는 않지만 사이트 서버 설정이나 $wgLocaltimezone 의 값을 사용합니다.

  • {{LOCALYEAR}}
  • {{LOCALMONTH}}
  • {{LOCALMONTH1}}
  • {{LOCALMONTH2}}
  • {{LOCALMONTHNAME}}
  • {{LOCALMONTHNAMEGEN}}
  • {{LOCALMONTHABBREV}}
  • {{LOCALDAY}}
  • {{LOCALDAY2}}
  • {{LOCALDOW}}
  • {{LOCALDAYNAME}}
  • {{LOCALTIME}}
  • {{LOCALHOUR}}
  • {{LOCALWEEK}}
  • {{LOCALTIMESTAMP}}

보다 자세한 시각을 포맷, 또는 현재의 연도와 주를 ISO-8601로 확실히 준거하여서 출력시키려면 확장기능:ParserFunctions 를 설치해서 #time 의 파서 함수를 사용해서 사용할 수 있습니다.

기술적인 메타데이터

변수 출력 설명 버전
사이트
{{SITENAME}} MediaWiki 위키 사이트 이름($wgSitename )
{{SERVER}} //www.mediawiki.org 위키 도메인 URL($wgServer 에서 설정 가능)
{{SERVERNAME}} www.mediawiki.org 하위 도메인 및 도메인 이름(버전 1.17 이후, $wgServerName 에 의존하지 않게 되었습니다)
{{DIRMARK}}

{{DIRECTIONMARK}}


위키의 기본 언어 방향 (왼쪽에서 오른쪽 위키에서 ‎, 오른쪽에서 왼쪽 위키에서 ‏)과 일치하는 유니코드 방향 표시를 출력하며, 다 방향 텍스트가있는 텍스트에 유용합니다. 1.19부터는 페이지 콘텐츠 언어에 따라 다릅니다.
1.7
r14442
{{ARTICLEPATH}} /wiki/$1 Relative article path ($wgArticlePath ).
{{SCRIPTPATH}} /w 스크립트 위치 상대경로($wgScriptPath )
{{STYLEPATH}} /w/skins 스킨 스타일 위치 상대경로($wgStylePath )
1.16
{{CURRENTVERSION}} 1.42.0-wmf.22 (bd76262) 미디어위키 버전
1.7
r14199
{{CONTENTLANGUAGE}}

{{CONTENTLANG}}

en

en

기본 사용 언어($wgLanguageCode )
1.7
r14661
페이지
{{PAGEID}} 60388 문서 식별자를 반환
1.20
Gerrit change 9858
{{PAGELANGUAGE}}
{{#language:{{PAGELANGUAGE}}}}
ko
한국어
현재 문서의 언어 코드를 반환합니다. 이 변수의 반환 코드는 {{#language:...}}를 사용해서 언어 명칭으로 변환할 수가 있습니다.
1.29
Gerrit change 330982
{{TRANSLATABLEPAGE}} Help:Magic words Returns the title of the translation page (the page other languages are translated from) if a page is translatable (including translated pages), and nothing if the page is not translatable.
1.41.0-wmf.8
Gerrit change 913677

<translate><!--T:1--> Translated unit. Language: <tvar name=lang>{{TRANSLATIONLANGUAGE}}</tvar>.</translate>

<translate><!--T:2--> Untranslated unit. Language: <tvar name=lang>{{TRANSLATIONLANGUAGE}}</tvar>.</translate>

번역된 번역 단위. 언어: ko.

Not translated unit. Language: en.

‎<translate> 태그 내의 번역된 문서에 사용할 필요가 있습니다. 현재의 번역 단위의 언어 코드를 반환합니다. 번역 문서에서 단위가 번역되고 있을 경우에는 번역 언어가 반환됩니다. 그 이외에는 소스 언어를 반환합니다. 이 변수가 반환하는 언어 코드는 {{#language:...}}를 사용해서 언어 이름으로 변환할 수 있습니다. 번역 관리자만이 사용할 필요가 있습니다.
1.36.0-wmf.8
Gerrit change 603472
{{PROTECTIONLEVEL:동작}} 입력한 기능('edit': 편집, 'move': 이동)에 대해, 현재 문서의 보호 상태('autoconfirm': 준보호, 'sysop': 보호)를 출력합니다. 보호 상태가 없으면 빈 문자열을 출력합니다.
1.15
r45587
{{PROTECTIONEXPIRY:동작}} 현재 문서의 ‘편집’이나 ‘이동’ 등 특정 조작에 대한 보호기한(예시: ‘20160418155030’나 ‘infinity’)를 출력합니다. 보호되어 있지 않은 경우 "무한대"를 변환합니다.
1.27
Gerrit change 255717
{{CASCADINGSOURCES}} [과부하] Returns the sources of any cascading protection acting on the current page. Pages will not return their own title unless they transclude themselves.
1.23
Gerrit change 104999
현재 문서의 최근 편집 기록
{{REVISIONID}} - 편집 기록 고유 ID 미리보기는 비어있기 때문에 미리보기에서만 오류 메시지를 보이게 할 수 있습니다. May be disabled in miser mode (all WMF wikis) returning - instead when not in preview.
1.5
{{REVISIONDAY}} 17 편집한 날(1~31 표기)
1.8
{{REVISIONDAY2}} 17 편집한 날(01~31 표기)
1.8
{{REVISIONMONTH}} 03 편집한 달(01~31로 표기. 1.17+보다 이전 버전의 경우는 1~31로 표기합니다.)
1.8
{{REVISIONMONTH1}} 3 Month edit was made (unpadded number).
1.17
r66200
{{REVISIONYEAR}} 2024 편집한 연도
1.8
{{REVISIONTIMESTAMP}} 20240317193210 편집한 시간
1.8
{{REVISIONUSER}} FuzzyBot 편집한 사용자명
1.15
r48149
{{REVISIONSIZE}} 94543 문서의 크기 (위키 문법의 바이트 수)
1.22
Gerrit change 82650
문서 출력
{{DISPLAYTITLE:제목}}
{{DISPLAYTITLE:제목|noerror}}
{{DISPLAYTITLE:제목|noreplace}}
현재 문서의 제목 텍스트를 지정합니다. 이 값은 기존 제목과 동일해야 합니다. (모든 문서에는 아니지만) 제목의 특정 부분을 대문자로 변경하거나, 밑줄 (_)을 썼을 때 공백이 되는 것을 비활성화 할 수 있습니다. ($1로 변경 가능합니다.) $2;로 활성화 여부를 선택할 수 있습니다. 1.10+ 버전 이전까지는 기본적으로 비활성화되고, 이후에는 기본적으로 활성화됩니다. Unless $wgRestrictDisplayTitle is set to false, the value must be equivalent to the default title: only capitalization changes to certain parts of the title (not all) and replacing spaces with underscores are allowed. It can be disabled or enabled by $wgAllowDisplayTitle .

It can take a second argument of noerror or noreplace to suppress error messages when multiple displaytitles are used on one page or to make this displaytitle do nothing if a displaytitle was already specified earlier in the page.

1.7
1.24
Gerrit change 144870

(for noerror and noreplace)

{{DEFAULTSORT:정렬키}}
{{DEFAULTSORTKEY:정렬키}}
{{DEFAULTCATEGORYSORT:정렬키}}
{{DEFAULTSORT:정렬키|noerror}}
{{DEFAULTSORT:정렬키|noreplace}}
문서 분류에 사용되는 정렬 키를 변경합니다. 예를 들면, John Smith의 마지막에 {{DEFAULTSORT:Smith, John }}를 위치시키면 문서는 기본값으로 "S" 아래로 분류에서 정렬됩니다. 하나의 문서에서 여러 기본값 정렬 키를 사용하고 있는 경우에는 경고 메시지를 억제하거나 문서 전반에 defaultsort가 이미 지정되어 있는 경우에는 이 defaultsort가 무엇도 하지 않게 하려면 "noerror" 또는 "noreplace"의 두 번째 인수를 취할 수 있습니다.
1.10
1.19
r96767

(for noerror and noreplace)

통계

Numbers returned by these variables normally contain separators (commas, dots or spaces, depending on the local language) but can return raw numbers with the ":R" flag (for example, {{NUMBEROFPAGES}} → 1,633,705 and {{NUMBEROFPAGES:R}} → 1633705).

Use "|R" for magic words that require a parameter like PAGESINCATEGORY (for example {{PAGESINCATEGORY:Help}} and {{PAGESINCATEGORY:Help|R}}, or {{PAGESINCATEGORY:Help|subcats}} and {{PAGESINCATEGORY:Help|subcats|R}}). Also applicable to {{PAGESIZE:page name}} hereinbefore.

The number magic words are formatted in the wiki content language. Since 1.19, it depends on the page content language.

변수 출력 설명 버전
{{NUMBEROFPAGES}} 1,633,705 위키 문서 수
1.7
{{NUMBEROFARTICLES}} 63,051 컨텐츠의 이름공간 중에 일반 이름공간 내의 문서 수. See Manual:$wgArticleCountMethod for details.
{{NUMBEROFFILES}} 2,797 올린 파일 수입니다.
1.5
{{NUMBEROFEDITS}} 6,310,457 위키 편집 수입니다.
1.10
r21319
{{NUMBEROFVIEWS}} 방문자 수입니다. 캐시를 사용하는 경우 대개 쓸모없습니다. Gerrit change 150699에서 제거됩니다.
1.14 – 1.24
r42721
{{NUMBEROFUSERS}} 17,908,552 등록된 사용자 수입니다.
1.7
{{NUMBEROFADMINS}} 133 관리자 그룹 에 있는 사용자 수입니다.
1.7
{{NUMBEROFACTIVEUSERS}} 928 Special:Statistics의 기준에 근거한 활동적인 사용자의 수입니다.
1.15
r47392
{{PAGESINCATEGORY:categoryname}}
{{PAGESINCAT:categoryname}}
129
129
[Expensive] Number of pages (including subcategories and files) in the given category. (분류:도움말 used for demonstration)
1.13
r32932
{{PAGESINCATEGORY:categoryname|all}}
{{PAGESINCATEGORY:categoryname|pages}}
{{PAGESINCATEGORY:categoryname|subcats}}
{{PAGESINCATEGORY:categoryname|files}}
129
126
3
0
[Expensive]

Respectively, the number of

  • all pages
  • ordinary pages (excluding subcategories and files)
  • subcategories or
  • files

in the given category. (분류:도움말 used for demonstration)

1.20
Gerrit change 12790
{{NUMBERINGROUP:그룹이름}}
{{NUMINGROUP:그룹이름}}
21
21
특정 그룹 에 있는 사용자 수입니다. (bureaucrat used for demonstration)
1.14
r40116
{{PAGESINNS:색인}}
{{PAGESINNAMESPACE:색인}}
활성화되지 않음 [Expensive] Number of pages in the given namespace (replace index with the relevant namespace index). For instance, {{PAGESINNAMESPACE:14}} will output the number of category pages. {{PAGESINNS:0}} differs from {{NUMBEROFARTICLES}} in that the former includes redirects and disambiguation pages. Disabled by default, enable with $wgAllowSlowParserFunctions .
1.7

문서 제목

변수 For current page 설명 버전
{{FULLPAGENAME}} Help:Magic words/ko 문서 제목, 이름공간 포함
1.6
{{PAGENAME}} Magic words/ko 문서 제목, 이름공간 제외
{{BASEPAGENAME}} Magic words 네임 스페이스가없는 바로 위에있는 서브 페이지 수준의 페이지 제목입니다. Would return Title/Foo on page Help:Title/Foo/Bar.
1.7
{{ROOTPAGENAME}} Magic words 현재 페이지의 루트의 이름. Would return Title on page Help:Title/Foo/Bar.
1.22
{{SUBPAGENAME}} ko 서브 페이지제목입니다. Would return Bar on page Help:Title/Foo/Bar.

If no subpage exists the value of {{PAGENAME}} is returned.

For more complex splitting, use {{#titleparts:}} from the ParserFunctions extension.

1.6
{{SUBJECTPAGENAME}}
{{ARTICLEPAGENAME}}
Help:Magic words/ko
Help:Magic words/ko
문서 이름공간의 문서 제목(이름공간 포함)
1.7
{{TALKPAGENAME}} Help talk:Magic words/ko 토론 이름공간의 문서 제목(이름공간 포함)
1.7

None of these are affected by changes to the display title using {{DISPLAYTITLE:xxxx}}; the values returned are the original page title.

The {{BASEPAGENAME}} and {{SUBPAGENAME}} magic words only work in namespaces that have subpages enabled. See $wgNamespacesWithSubpages for information on enabling subpages.

As of 1.15+, these can all take a parameter, allowing specification of the page to be operated on, instead of just the current page:

  • {{PAGENAME:Template:Main Page}} → Main Page
경고 경고: If the page title contains any parts that are "." or "..", the magic word returns nothing.
{{PAGENAME:one/./three}}아무 것도 변환되지 않습니다.
경고 경고: Page titles containing certain characters, such as apostrophes ' or asterisks *, may produce unexpected results when handled with these magic words, e.g. {{PAGESINCATEGORY:{{PAGENAME}}}}. See bugs T16779, T18474, T37628, T37746. One simple way to fix this is wrapping the pagename in {{#titleparts:}} from the ParserFunctions extension.

URL 인코드된 페이지 이름

The following are equivalents encoded for use in MediaWiki URLs (i.e. spaces replaced with underscores and some characters HTML escaped using numeric character encoding):

  • {{FULLPAGENAMEE}}
  • {{PAGENAMEE}}
  • {{BASEPAGENAMEE}}
  • {{SUBPAGENAMEE}}
  • {{SUBJECTPAGENAMEE}}
  • {{ARTICLEPAGENAMEE}}
  • {{TALKPAGENAMEE}}
  • {{ROOTPAGENAMEE}}

Note that {{PAGENAME:...}}, {{PAGENAMEE:...}} and {{urlencode:...}} have distinct implementations. See Manual:PAGENAMEE encoding for details.

이름공간

변수 출력 설명 버전
{{NAMESPACE}} Help 문서 이름공간의 이름 (except for main space)
{{NAMESPACENUMBER}} 12 문서 이름공간의 ID
1.20
Gerrit change 4056
{{SUBJECTSPACE}}
{{ARTICLESPACE}}
Help
Help
Name of the associated content namespace
1.7
{{TALKSPACE}} Help talk 문서의 토론 이름공간. {{SUBJECTSPACE}}과 반대의 기능입니다.
1.7

The following are equivalents encoded for use in MediaWiki URLs (spaces replaced with underscores and some characters percent-encoded):

  • {{NAMESPACEE}}
  • {{SUBJECTSPACEE}}
  • {{ARTICLESPACEE}}
  • {{TALKSPACEE}}

As of 1.15+, these can take a full-page-name parameter and will return the requested namespace associated with that page, instead of with the current page:

  • {{NAMESPACENUMBER:MediaWiki}}0
  • {{NAMESPACE:MediaWiki}} (Pages in main space will return empty)
  • {{NAMESPACE:Template:Main Page}}Template
  • {{SUBJECTSPACE:Template:Main Page}}Template
  • {{ARTICLESPACE:Template:Main Page}}Template
  • {{TALKSPACE:Template:Main Page}}Template talk

Parameter must not be a namespace name:

  • {{SUBJECTSPACE:Help talk}}  (Empty)


기타

변수 출력 설명 버전
{{!}} | 틀 인수의 일부로 파이프 문자(수직선)을 넣어줍니다. 이 특수 명령문이 추가되기 이전에는 많은 위키들이 Template:!을 따로 만들어 |를 직접 넣었습니다.

See Help:Extension:ParserFunctions#Escaping pipe characters in tables for further explanation.

1.24
Gerrit change 136234
{{=}} = Used to include an equal sign as part of a template argument or table cell contents. Before this was added as a magic word, many wikis implemented this by creating Template:= with = as the content.

See Help:Extension:ParserFunctions#Raw equal signs for further explanation.

1.39
Gerrit change 791685

파서 함수

Parser functions are very similar to variables but take one or more parameters (technically, any magic word that takes a parameter is a parser function), and the name is sometimes prefixed with a hash to distinguish them from templates.

This page only describes parser functions that are integral to the MediaWiki software. Other parser functions may be added by MediaWiki extensions such as the 확장기능:ParserFunctions . For those see 도움말:확장기능:파서 함수 .

다른 문서의 기술적인 메타데이터

파서 함수 (MediaWiki 페이지에 대한)
출력
설명 버전
{{PAGEID: 문서 이름 }} 1 [Expensive] Returns the page identifier of the specified page*.
1.23
Gerrit change 76534
{{PAGESIZE:문서 이름}}
{{PAGESIZE: 문서 이름 |R}}
101,005
101005
[Expensive] Returns the byte size of the specified page. Use "|R" to get raw (unformatted) numbers.
1.13
r33551
{{PROTECTIONLEVEL:동작 | 문서 이름}} sysop [Expensive] Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the specified page. Returns an empty string if not protected.
1.21
r44683
{{PROTECTIONEXPIRY: action | page name}} infinity [Expensive] Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the specified page. Returns "infinity" if not protected.
1.27
Gerrit change 255717
{{CASCADINGSOURCES: page name}} [Expensive] Returns the sources of any cascading protection acting on the specified page. Pages will not return their own title unless they transclude themselves.
1.23
Gerrit change 104999
{{REVISIONID: 문서 이름 }} 6287429 [Expensive] Unique revision ID of the last revision on the specified page*.
1.23
Gerrit change 76534
{{REVISIONDAY: 문서 이름 }} 29 [Expensive] Day of edit from the last revision of the specified page* (unpadded number).
1.23
Gerrit change 76534
{{REVISIONDAY2: 문서 이름 }} 29 [Expensive] Day of edit from the last revision of the specified page* (zero-padded number).
1.23
Gerrit change 76534
{{REVISIONMONTH: 문서 이름 }} 12 [Expensive] Month of edit from the last revision of the specified page* (zero-padded number as of 1.17+, unpadded number in prior versions).
1.23
Gerrit change 76534
{{REVISIONMONTH1: 문서 이름 }} 12 [Expensive] Month of edit from the last revision of the specified page* (unpadded number).
1.23
Gerrit change 76534
{{REVISIONYEAR: 문서 이름 }} 2023 [Expensive] Year of edit from the last revision of the specified page*.
1.23
Gerrit change 76534
{{REVISIONTIMESTAMP: 문서 이름 }} 20231229181425 [Expensive] Timestamp as of time of edit on the specified page*.
1.23
Gerrit change 76534
{{REVISIONUSER: 문서 이름 }} Tropicalkitty [Expensive] The username from the last revision on the specified page*.
1.23
Gerrit change 76534
  • When the given param is equal to the current title of the parser, the parser function will yield the previous versions on preview and on substitution, that includes empty strings when used on page creation but using the values from the current version for page view, including viewing old revisions. In this case it is a non-expensive parser function.


URL 데이터

파서 함수 입력 → 출력 설명 버전
{{localurl:문서 이름}}
{{localurl:문서 이름
|query_string}}
{{localurl:MediaWiki}}
→ /wiki/MediaWiki
{{localurl:MediaWiki|printable=yes}}
→ /w/index.php?title=MediaWiki&printable=yes
The relative path to the title.
{{fullurl:문서 이름}}
{{fullurl:문서 이름
|query_string}}

{{fullurl:interwiki:remote page name
|query_string}}
{{fullurl:Category:Top level}}
→ //www.mediawiki.org/wiki/Category:Top_level

{{fullurl:Category:Top level|action=edit}}
→ //www.mediawiki.org/w/index.php?title=Category:Top_level&action=edit
{{fullurl:s:Electra|action=edit}}
https://en.wikisource.org/wiki/Electra?action=edit
{{fullurl:s:es:Electra|action=edit}}
https://en.wikisource.org/wiki/es:Electra?action=edit

A protocol-relative path to the title, which depends on the $wgServer configuration setting for the local wiki (and so may or may not start with http(s)://). This will also resolve interwiki prefixes. Note: Unbracketed (plain) protocol-relative links are not automagically linked.
1.5
{{canonicalurl:문서 이름}}
{{canonicalurl:문서 이름
|query_string}}

{{canonicalurl:interwiki:remote page name
|query_string}}
{{canonicalurl:Category:Top level}}
https://www.mediawiki.org/wiki/Category:Top_level

{{canonicalurl:Category:Top level|action=edit}}
https://www.mediawiki.org/w/index.php?title=Category:Top_level&action=edit {{canonicalurl:w:Category:Top level|action=edit}}
https://en.wikipedia.org/wiki/Category:Top_level?action=edit

The absolute path to the title, using the canonical URL. This will also resolve interwiki prefixes.
1.18
{{filepath:file name}}
{{filepath:file name|nowiki}}
{{filepath:file name|thumbnail_size}}
{{filepath:Wiki.png}}
→ //upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png

{{filepath:Wiki.png|nowiki}}
→ //upload.wikimedia.org/wikipedia/mediawiki/b/bc/Wiki.png
{{filepath:Example.svg|300}}
→ //upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/300px-Example.svg.png

The parameter nowiki usually removes the link around the filepath (which can't be seen in this example).

A protocol-relative path to the full size or thumbnail (1.18+) of a media file.
1.12
r25854

1.18
r80813
{{urlencode:string}} or
{{urlencode:string|QUERY}}
{{urlencode:string|WIKI}}
{{urlencode:string|PATH}}
{{urlencode:x:y/z á é}} or
{{urlencode:x:y/z á é|QUERY}}
→ x%3Ay%2Fz+%C3%A1+%C3%A9
{{urlencode:x:y/z á é|WIKI}}
→ x:y/z_%C3%A1_%C3%A9
{{urlencode:x:y/z á é|PATH}}
→ x%3Ay%2Fz%20%C3%A1%20%C3%A9

Note that the default changed from |WIKI to |QUERY in 1.17; this may break templates that rely on this function.

The input encoded for use in URLs. Note that there is no urldecode function like there is in the obsolete Extension:StringFunctions
인코딩
코드스페이스
 none + 
QUERY + 
 WIKI _ 
 PATH%20
1.7
r14273
(or
1.17
r64726

1.17
r64726

1.17
r64726
)
{{anchorencode:문자열}} {{anchorencode:x y z á é}}
→ x_y_z_á_é
The input encoded for use in URL section anchors (after the “#” symbol in a URL).
1.6
r16279

The following are equivalents encoded for use in MediaWiki URLs (some characters percent-encoded):

  • {{localurle:page name}}
  • {{localurle:page name|query_string}}
  • {{fullurle:page name}}
  • {{fullurle:page name|query_string}}
  • {{fullurle:interwiki:remote page name|query_string}}
  • {{canonicalurle:page name}}
  • {{canonicalurle:page name|query_string}}
  • {{canonicalurle:interwiki:remote page name|query_string}}

이름공간

{{ns:}} returns the current localized name for the namespace with that index, canonical name, or local alias. Thus {{ns:6}}, {{ns:File}}, and {{ns:Image}} (an old name for the File namespace) all return "File". On a wiki where the content language is French, {{ns:Fichier}} is also valid, but {{ns:Datei}} (the localisation of "File" in German) is not.

The main namespace has no name, i.e. {{ns:0}} returns an empty string. For explicitly referring to the main namespace, {{int:Blanknamespace}} can be used, resulting in "(일반)".

{{nse:}} is the equivalent encoded for MediaWiki URLs. It does the same, but it replaces spaces with underscores, making it usable in external links.

내용 이름공간 토론 이름공간
사용법 출력 사용법 출력
{{ns:-2}} / {{ns:Media}} Media {{ns:-1}} / {{ns:Special}} Special
(no talk page)
{{ns:0}} / {{ns:}} {{ns:1}} / {{ns:Talk}} Talk
{{ns:2}} / {{ns:User}} User {{ns:3}} / {{ns:User talk}} User talk
{{ns:4}} / {{ns:Project}} Project
Varies between wikis
{{ns:5}} / {{ns:Project talk}} Project talk
{{ns:6}} / {{ns:File}} or {{ns:Image}} File {{ns:7}} / {{ns:File talk}} or {{ns:Image talk}} File talk
{{ns:8}} / {{ns:MediaWiki}} MediaWiki {{ns:9}} / {{ns:MediaWiki talk}} MediaWiki talk
{{ns:10}} / {{ns:Template}} Template {{ns:11}} / {{ns:Template talk}} Template talk
{{ns:12}} / {{ns:Help}} Help {{ns:13}} / {{ns:Help talk}} Help talk
{{ns:14}} / {{ns:Category}} Category {{ns:15}} / {{ns:Category talk}} Category talk

Don't confuse localised namespaces with custom namespaces.

형식

사용법 입력 → 출력 설명 버전

{{formatnum:unformatted number}}
{{formatnum:formatnum-formatted number|R}}
{{formatnum:unformatted number|NOSEP}}

  • 간단:
    • {{formatnum:987654321.654321}}
      → 987,654,321.654321
    • {{formatnum:987,654,321.654321|R}}
      → 987654321.654321
  • 고급:
    • {{formatnum:{{formatnum:987654321.654321}}|R}}
      → 987654321.654321 (어떠한 로케일에서)
    • {{formatnum:00001}}
      → 00,001
    • {{formatnum:987654321.654321 |NOSEP}}
      → 987654321.654321
    • Examples with Bangla locale:
      • {{formatnum:987654321.654321}}
        → ৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১
      • {{formatnum:987654321.654321 |NOSEP}}
        → ৯৮৭৬৫৪৩২১.৬৫৪৩২১
      • {{formatnum:৯৮,৭৬,৫৪,৩২১.৬৫৪৩২১ |R}}
        → 987654321.654321

지원되지 않음:
{{formatnum:{{formatnum:987.654.321}}}}
→ 987 654 321 (예로 이탈리아어 로케일로)


Examples of wrong input (unreliable output), with or without |R:
{{formatnum:987,654.321|R}} (the least broken)
{{formatnum:987.654,321|R}}
{{formatnum:987 654,321|R}}
{{formatnum:987&nbsp;654,321|R}}

Takes an unformatted number (Arabic, no group separators and . as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the page language.

The |R parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers which are known to be formatted exactly as formatnum formats them with the wiki's locale.
The NOSEP ("no separators") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the Hindu–Arabic numeral system. NOSEP can also prevent non-standard digit groupings you wouldn't expect.

경고 경고: Leading zeroes are not removed, you can use {{#expr:00001}} instead if you have 확장기능:ParserFunctions installed.

경고 경고: If you don't input numbers in the exact format required, don't expect any reliable output, especially on non-English wikis.


If you really need to format (according the wiki's locale) a number in unknown input format, you could try and use formatnum two times (but not if it can have a decimal group, or its separator will be eaten or the number won't be formatted). Be aware that this is more a hack than a regular way to proceed, thus the output may be not reliable.

1.7

1.13
r32012

{{#dateformat:date}}
{{#formatdate:date}}
{{#dateformat:date|format}}
{{#formatdate:date|format}}

{{#dateformat:25 dec 2009|ymd}}
→ 25 dec 2009 (your pref), 2009 December 25 (default)
{{#formatdate:dec 25,2009|dmy}}
→ dec 25,2009 (your pref), 25 December 2009 (default)
{{#dateformat:2009-12-25|mdy}}
12월 25, 2009 (your pref), December 25, 2009 (default)
{{#formatdate:2009 dec 25|ISO 8601}}
→ 2009 dec 25 (your pref), 2009-12-25 (default)
{{#dateformat:25 decEmber|mdy}}
→ 25 decEmber (your pref), December 25 (default)

Note: In the examples above, "your pref" refers to your date preference on the current MediaWiki wiki only.

Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: mdy, dmy, ymd, ISO 8601 (all case sensitive). If only the month and day are given, only mdy and dmy are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.
경고 경고: Although the ISO 8601 standard requires that dates be in the Gregorian calendar, the ISO parameter in this function will still format dates that fall outside the usual Gregorian range (e.g. dates prior to 1583). Also, the magic word cannot properly convert between negative years (used with ISO 8601) and years BC or years BCE (used in general writing).
1.15
r48249

{{lc:string}}

{{lc:DATA CENTER}} → data center 소문자로 입력합니다.
1.5

{{lcfirst:string}}

{{lcfirst:DATA center}} → dATA center 맨 처음 글자를 소문자로 입력합니다.
1.5

{{uc:string}}

{{uc:text transform}} → TEXT TRANSFORM 대문자로 입력합니다.
1.5

{{ucfirst:string}}

{{ucfirst:text tRAnSFORM}} → Text tRAnSFORM 맨 처음 글자를 대문자로 입력합니다.
1.5

{{padleft:xyz|stringlength}}
{{padleft:xyz|strlen|char}}
{{padleft:xyz|strlen|string}}

{{padleft:xyz|5}} → 00xyz

{{padleft:xyz|5|_}} → __xyz
{{padleft:xyz|5|abc}} → abxyz
{{padleft:xyz|2}} → xyz
{{padleft:|1|xyz}} → x (first character of the string)

Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding; i.e. {{padleft:44|3|0}} produces 044. The padding string may be truncated if its length does not evenly divide the required number of characters.

Only the first character of the third parameter is used in versions up to 1.12, but by version 1.15, all the characters are used.

Bug (fixed in r45734): multibyte characters are interpreted as two characters, which can skew width. These also cannot be used as padding characters.

1.8

1.15
r45734

{{padright:xyz|stringlength}}
{{padright:xyz|strlen|char}}
{{padright:xyz|strlen|string}}

{{padright:xyz|5}} → xyz00

{{padright:xyz|5|_}} → xyz__
{{padright:xyz|5|abc}} → xyzab
{{padright:xyz|2}} → xyz
{{padright:|1|xyz}} → x

Identical to padleft but adds padding characters to the right side.
1.8

1.15
r45734

{{bidi:string}}

{{bidi:text transform}} → ‪text transform‬

{{bidi:كتابة عربية}} → ‫كتابة عربية‬

Wraps the text in a script-appropriate directionality marker (either left-to-right (U+202A) or right-to-left (U+202B)) and a pop directionality formatting character (U+202C), to ensure directionality safety when using a mix of scripts in running text.

같이 보기: Extension:StringFunctions .

지역화

Here are the magic words which are used as main localisation tools. Other magic words will often depend on the wiki's locale and configuration or on the chosen language: see in particular #Date and time, #Formatting, #Miscellaneous. More magic words are added by the 확장기능:번역 .

The usage of these magic words can be very complex, and the documentation is currently incomplete; there's some more info on PLURAL, GRAMMAR, GENDER.

사용법 입력 → 출력 설명 버전
{{PLURAL:2|is|are}} {{PLURAL:0|is|are}} → are
{{PLURAL:1*1|is|are}} → is
{{PLURAL:21 mod 10|is|are}} → are
{{PLURAL:{{#expr:21 mod 10}}|is|are}} → is
{{PLURAL:1|is|are}} → is
{{PLURAL:2|is|are}} → are
{{PLURAL:-1|is|are}} → is
{{PLURAL:-2|is|are}} → are
{{PLURAL:0.5|is|are}} → are
{{PLURAL:1.5|is|are}} → are
{{PLURAL:-0.5|is|are}} → are
{{PLURAL:-1.5|is|are}} → are
(러시아어로는)
{{PLURAL:5|1=Категория|Категории}} → Категории


{{PLURAL:3|страница|страницы|страниц}} → страницы
{{PLURAL:5|страница|страницы|страниц}} → страниц

Outputs the singular form (second parameter) if the absolute value of the first parameter is an expression equalling one; the plural form (third parameter) otherwise. Its functioning is language-dependent.
Some language codes (ab, av, ba, bxr, ce, crh_cyrl, cv, inh, koi, krc, kv, lbe, lez, mhr, mrj, myv, ru, sl, tt_cyrl, tyv, udm, xal) used 3 plural forms (updated 01.2014):
  • Form 1: 1, 21, 31, 41, 51, 61, 71, 81, 101, 1001, …
  • Form 2: 0, 5, 6, 7, 8, …, 18, 19, 100, 1000, 10000, 100000, 1000000, …
  • Form 3: 2, 3, 4, 22, 23, 24, 32, 33, 34, 42, 43, 44, 52, 53, 54, 62, 102, 1002, …
{{GRAMMAR:N|noun}} Outputs the correct inflected form of the given word described by the inflection code after the colon (language-dependent). Grammar transformations are used for inflected languages like Polish. See also $wgGrammarForms .
1.7
{{GENDER:username|text for every gender}}

{{GENDER:Username|male text|female text|text for unspecified}}
{{GENDER:|male text|female text|text for unspecified}}
{{GENDER:.|male text|female text|text for unspecified}}

(지정된 사용자의 성별에 의존합니다)

A switch for the gender set in Special:Preferences.
Note: The first example is basically a no-op
Note: If 3rd parameter is omitted and user hasn't defined their gender, then text if user is male is returned.
A blank username field ({{GENDER:|) means the current user, but can be used only in interface messages (MediaWiki namespace).
A dot username (.) means the default user gender on this wiki.

1.15
r46247
{{int:메시지 이름}} {{int:edit}}Edit
(Depends on user language; try: frja)
Internationalizes (translates) the given interface (MediaWiki namespace) message into the user language. For msgnw and other transclusion magic words, see the Transclusion modifiers section.

Note that this can damage / confuse cache consistency in MediaWiki 1.17 and earlier, see T16404.

{{int:editsectionhint|MediaWiki}} {{int:editsectionhint|MediaWiki}}Edit section: MediaWiki You may also use parameters with translations.
Parameters are designated in messages with: $1, $2, $3, etc.
For example, here is the message for editsectionhint: Edit section: $1
In this example, MediaWiki replaces $1.


Transclusion modifiers

{{Page name|optional params}} usually transcludes another page, by default from the Template:namespace. These magic words modify that behavior.

잡다한 것들

See also