Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  



























Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 General syntax  



1.1  Transcluding a different page  





1.2  Using the |content= parameter  







2 Advanced syntax  



2.1  Customizing the heading  





2.2  Customizing the link box  





2.3  Testing  







3 Placement and tags  



3.1  Categories and interwikis  







4 Technical details  



4.1  Automatic functions  





4.2  Link box features  





4.3  Subject namespaces vs. talk namespaces  







5 Full syntax  



5.1  Color scheme  







6 See also  














Template:Documentation






Acèh
Адыгэбзэ
Адыгабзэ
Afrikaans
ak:Nhwɛsode:Documentation
Alemannisch
Алтай тил

Anarâškielâ
ि
Ænglisc
Аԥсшәа
العربية
Aragonés
ܐܪܡܝܐ
Արեւմտահայերէն
Arpetan

Asturianu
Atikamekw
Авар
Aymar aru
Azərbaycanca
تۆرکجه
Basa Bali
Bamanankan

Banjar
 / Bân-lâm-gú
Basa Banyumasan
Башҡортса
Беларуская
Беларуская (тарашкевіца)

Bikol Central
Bislama
Български
Boarisch

Bosanski
Brezhoneg
Буряад
Català
Чӑвашла
Cebuano
Čeština
Chamoru
Chavacano de Zamboanga
Chi-Chewa
ChiShona
ChiTumbuka
Corsu
Cymraeg
Dansk
الدارجة
Davvisámegiella
Deutsch
ދިވެހިބަސް
Dolnoserbski


Eesti
Ελληνικά
Emiliàn e rumagnòl
Эрзянь
Español
Esperanto
Estremeñu
Euskara
Eʋegbe
Farefare
فارسی
Fiji Hindi
Français
Frysk
Fulfulde
Furlan
Gaeilge
Gaelg
Gagauz
Gàidhlig
Galego
ГӀалгӀай

Gĩkũyũ
گیلکی

𐌲𐌿𐍄𐌹𐍃𐌺
  / Gõychi Konknni
Gungbe
/Hak-kâ-ngî
Хальмг

Hausa
Hawaiʻi
Հայերեն
ि
Hornjoserbsce
Hrvatski
Bahasa Hulontalo
Ido
Igbo
Ilokano
িি ি
Bahasa Indonesia
Interlingua
Interlingue
 / inuktitut
Ирон
IsiXhosa
IsiZulu
Íslenska
Italiano
עברית
Jawa
Kabɩyɛ
Kalaallisut

Kapampangan
Къарачай-малкъар

 / کٲشُر
Kaszëbsczi
Қазақша
Kernowek
Ikinyarwanda
Ikirundi
Kiswahili
Kongo
Kreyòl ayisyen
Kriyòl gwiyannen
Kurdî
Кыргызча
Кырык мары
Ladino

Latgaļu
Latina
Latviešu
Lëtzebuergesch
Лезги
Lietuvių
Ligure
Limburgs
Lingála
Livvinkarjala
La .lojban.
Luganda
Lombard
Magyar
Madhurâ
ि
Македонски
Malagasy

Malti
Māori


مصرى

مازِرونی
Bahasa Melayu
Mfantse
Minangkabau
 / Mìng-dĕ̤ng-nḡ
Mirandés
Мокшень
Монгол

Nāhuatl
Na Vosa Vakaviti
Nederlands
Nedersaksies
Nēhiyawēwin / 

 

Napulitano
ߒߞߏ
Нохчийн
Norfuk / Pitkern
Norsk bokmål
Norsk nynorsk
Nouormand
Novial
Occitan
Олык марий
ି
Oromoo
Oʻzbekcha / ўзбекча

ि
Pälzisch
Pangasinan
Pangcah
پنجابی

Papiamentu
پښتو
Patois
Перем коми

Picard
Piemontèis
Pinayuanan
Tok Pisin
Plattdüütsch
Polski
Português
Qaraqalpaqsha
Qırımtatarca
Reo tahiti
Română
Rumantsch
Runa Simi
Русиньскый
Русский
Саха тыла
Sakizaya
Gagana Samoa

Sängö

سرائیکی
Sardu
Scots
Seediq
Seeltersk
Sesotho sa Leboa
Setswana
Shqip
Sicilianu

Simple English
سنڌي
Slovenčina
Slovenščina
Словѣньскъ / 
Ślůnski
Soomaaliga
کوردی
Sranantongo
Српски / srpski
Srpskohrvatski / српскохрватски
Sunda
Suomi
Svenska
Tagalog
ி
Taqbaylit
Tarandíne
Татарча / tatarça
 
Tayal

Tetun

Thuɔŋjäŋ

Тоҷикӣ

Tsetsêhestâhese
Tshivenda

Türkçe
Türkmençe
Twi
Tyap
Тыва дыл
Удмурт
Basa Ugi
Українська
اردو
ئۇيغۇرچە / Uyghurche
Vahcuengh
Vèneto
Vepsän kel
Tiếng Vit
Volapük
Walon
Wayuunaiki

Winaray
Wolof

Xitsonga
ייִדיש
Yorùbá

Zazaki
Žemaitėška

Batak Toba
Betawi
Tolışi
 
 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
MediaWiki
Meta-Wiki
Wikimedia Outreach
Multilingual Wikisource
Wikispecies
Wikibooks
Wikidata
Wikifunctions
Wikimania
Wikinews
Wikiquote
Wikisource
Wikiversity
Wikivoyage
Wiktionary
 

















Permanently protected template

From Wikipedia, the free encyclopedia
 


The {{documentation}} template is used to contain the documented information and instructions of a certain template, usually from a /doc subpage. It can also be configured to load the content from other pages or be directly fed by text.

For detailed instructions on how and when to use this template, see Wikipedia:Template documentation (shortcut: WP:TDOC).

This template has two parts: the big "documentation box" with the documentation inside alongside a toolbar (the [view][edit][history][purge] links), and the smaller "link box" that shows metadata about the documentation alongside the sandbox and testcases links.

Use of this template allows templates to be protected, where necessary, while allowing anyone to edit the documentation and categories.

General syntax

Normally, the template is used without parameters and is placed inside <noinclude>...</noinclude> at the bottom of the template page (see § Placement and tags for more information):

<!--Last line of your template code--><noinclude>
{{Documentation}}
<!-- Add categories to the /doc subpage -->
</noinclude>

Transcluding a different page

To transclude a different page other than the /doc subpage, simply provide |1= like this:

<!--Last line of your template code--><noinclude>
{{Documentation|Template:Other page/doc}}
</noinclude>

Note that when loading the documentation from a page other than the local /doc subpage, it becomes tricky to handle the categories.

Using the |content= parameter

The documentation can also be fed directly as text, by using the |content= parameter:

<!--Last line of your template code--><noinclude>
{{Documentation
 | content =
<!-- template documentation -->
}}</noinclude>

When using this parameter, the toolbar will not show. Note that the /doc subpage in the link box will still show up if it exists.

Also note that when |1= and |content= is specified, |content= takes precedence and always shows in the documentation box.

Advanced syntax

Customizing the heading

The heading in the documentation box changes depending on namespace. See the below list for the default text in each namespace:

To customize the heading, simply set the parameter |heading= to anything you like, for example |heading=Infobox documentation.

Note that if the heading parameter is empty but defined (like |heading=) the heading alongside the toolbar will not show.

The |heading-style= parameter can be fed optional CSS values, like |heading-style=font-size:150%;color:red;. Not that you should omit quotation marks " " and add the ending semicolon ;.

Customizing the link box

To customize the link box, simply set |link box= to something else, like |link box=The above documentation is automatically generated from Template:Foo.

To hide the link box, simply set |link box=tooff.

Testing

You can simulate the output for a given page by using the |page= parameter. For example, if you use the code |page=Template:Edit protected, the template will behave exactly as if it were on the page Template:Edit protected, including showing the documentation from Template:Edit protected/doc, linking to Template:Edit protected/sandbox, etc. This parameter is useful for testing and is used extensively on the module testcases page.

Placement and tags

This code should be added at the bottom of the template code page, with no space before <noinclude> (which causes extra whitespace to show on pages where the template is transcluded):

<!--Last line of your template code--><noinclude>
{{documentation}}
<!-- Add categories to the /doc subpage -->
</noinclude>

To automatically insert the above text, you can also use the substitution code shortcut {{subst:doc-code}}.

Categories and interwikis

Depending on where to the documentation is placed, it may be tricky to handle the categories and interwikis. See Wikipedia:Template documentation § Categories and interwiki links for information about adding these.

Technical details

Automatic functions

If the documentation page does not exist, the toolbar is replaced with a [create] link. It automatically creates the page with preloaded text with the basic documentation syntax. Preload text is also used for the /sandbox and /testcases [create] links.

The preload page for the /doc [create] link is Template:Documentation/preload. The preload pages for the /sandbox and /testcases links are Template:Documentation/preload-sandbox and Template:Documentation/preload-testcases. The preload page for the /sandbox [mirror] link is Template:Documentation/mirror.

This template also automatically adds {{pp-template}} to a protected template page, so no need to manually add this template to protected pages.

When this template is on a /sandbox subpage it automatically adds the {{Template sandbox notice}} template.

Link box features

Depending on the namespace, the link box may have less features, or may not show up at all. The following table shows this:

Namespace Behavior
Template Full behavior
Module Full behavior, with the addition of a "create documentation" link when the page does not exist
User Full behavior
Other namespaces Hidden, unless |1= is specified (which will show "The above documentation is transcluded from {{{1}}}")

Alongside that, if |1=or|content= is specified, the "Add categories to the /doc subpage" will not show.

Subject namespaces vs. talk namespaces

This template is usually placed in the subject namespace. But in some cases this template needs to be on the Talk namespace:

When placed on talk pages, this template usually is placed near the top of the page and without <noinclude>...</noinclude> tags.

The /doc, /sandbox and /testcases pages should normally be in the subject namespace, except in the namespaces that do not have the MediaWiki subpage feature enabled: Main, File, and MediaWiki. (Categories can have subpages, but documentation is created in the Category talk namespace to prevent creating empty categories. There are also a whole bunch of other technical reasons why the /doc page must be stored under the talk page for those (but only those) namespaces.

This template automatically points its [create] links for the /doc, /sandbox and /testcases to the right namespace.

Full syntax

{{Documentation}}or{{Documentation
 | [path to documentation page]
}}

{{Documentation
 | content =
}}or{{Documentation
| [path to documentation page]
| heading-style = 
| heading = 
| link box = 
}}or{{Documentation
| [path to documentation page]
| content = 
| heading-style = 
| heading = 
| link box = 
| page =
}}

Color scheme

Wikipedia background colors for {{documentation}} (Help:Using colors)
RGB HSV Color General usage Note
#ECFCF4 150°, 6%, 99%   Sample Current documentation background
B #00FF80 Hue=150° (41.7%; 106/255dec) 100%, 100%   Basic hue What we'd call the color
1 #A3BFB1 150°, 15%, 75%   Header border only
2 #CEF2E0 150°, 15%, 95%   Main border; header background
3 #E6FFF2 150°, 10%, 100%   2nd header, accent colour
4 #F5FFFA 150°, 4%, 100%   Main background So saturation in A is a bit off

Colors for documentation navbox

As a suggestion, here are colors for a navbox intended for documentation pages only. They follow the shading of regular blue navbox colors:

| titlestyle = background:#ccffe5
| basestyle  = background:#ddffee
<!-- basestyle= sets groupstyle, abovestyle, belowstyle together -->

For subgroups, in child navboxes:

{{Navbox|child
| groupstyle = background:#e6fff2
...

Example:{{Periodic table templates overview}}

See also


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Documentation&oldid=1079870366"

Categories: 
Lua-based templates
Documentation templates
Template namespace templates
Hidden categories: 
Wikipedia template-protected templates
Wikipedia substituted templates
 



This page was last edited on 29 March 2022, at 02:14 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki