Відмінності між версіями «Шаблон:Documentation/core»
Матеріал з Аероскан Сервіс
								
												
				|  (Adding the "link box = off" parameter.) |  (Using the heading "Summary" instead of "Documentation" when in File space. Adding "Add categories and interwikis to the /doc". Adding link "Subpages of this template". Adding debug-reporting to a cat.) | ||
| Рядок 17: | Рядок 17: | ||
|    }} <span style="{{#if: {{{heading-style|}}} |    }} <span style="{{#if: {{{heading-style|}}} | ||
|    | {{{heading-style|}}} |    | {{{heading-style|}}} | ||
| − |    | {{#ifeq: {{ | + |    | {{#ifeq: {{SUBJECTSPACE}} | {{ns:Template}} | 
|      | font-weight: bold; font-size: 125% |      | font-weight: bold; font-size: 125% | ||
|      | font-size: 150% |      | font-size: 150% | ||
| Рядок 24: | Рядок 24: | ||
|    | ¬ =     |    | ¬ =     | ||
|      <!--"heading" not defined in this or previous level--> |      <!--"heading" not defined in this or previous level--> | ||
| − |      {{# | + |      {{#switch: {{SUBJECTSPACE}}   | 
| − | + |     | {{ns:Template}} = [[Image:Template-info.svg|50px]] Template documentation | |
| − |      | Documentation | + |      | {{ns:File}} = Summary | 
| + |     | #default = Documentation | ||
|      }} |      }} | ||
|    | #default =   |    | #default =   | ||
| Рядок 34: | Рядок 35: | ||
| }}<!-- | }}<!-- | ||
|    Load the /doc content: |    Load the /doc content: | ||
| − |    Note: The line  | + |    Note: The line breaks between this comment and the if-case | 
| − | + |    and between the if-case and the following div are necessary so   | |
| − | + |   "=== Headings ===" at the start and end of docs are interpreted. | |
| --> | --> | ||
| {{#if: {{{content|}}} | {{#if: {{{content|}}} | ||
| Рядок 44: | Рядок 45: | ||
|    }} |    }} | ||
| }} | }} | ||
| − | <div style="clear: both;"></div> | + | <div style="clear: both;"></div><!--So right or left floating items don't stick out of the doc box.--> | 
| </div><!--End of green doc box--><!-- | </div><!--End of green doc box--><!-- | ||
|    Small box below for the doc meta-data. |    Small box below for the doc meta-data. | ||
| Рядок 62: | Рядок 63: | ||
|    | image = none |    | image = none | ||
|    | style = background-color: #ecfcf4; |    | style = background-color: #ecfcf4; | ||
| + |   | textstyle = font-style: italic; | ||
|    | text =   |    | text =   | ||
| − | + |      {{#if: {{{doc exist|yes}}} | |
|      | <!--/doc exists, link to it--> |      | <!--/doc exists, link to it--> | ||
|        The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from [[{{{docpage|{{FULLPAGENAME}}/doc}}}]]. <small style="font-style: normal">([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=edit}} edit] | [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=history}} history])</small> <br> |        The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from [[{{{docpage|{{FULLPAGENAME}}/doc}}}]]. <small style="font-style: normal">([{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=edit}} edit] | [{{fullurl:{{{docpage|{{FULLPAGENAME}}/doc}}}|action=history}} history])</small> <br> | ||
| Рядок 79: | Рядок 81: | ||
|        | [[{{{testcases| {{FULLPAGENAME}}/testcases }}}|testcases]] <small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit }} edit])</small> |        | [[{{{testcases| {{FULLPAGENAME}}/testcases }}}|testcases]] <small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit }} edit])</small> | ||
|        | testcases <small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit&preload=Template:Documentation/preload-testcases }} create])</small> |        | testcases <small style="font-style: normal">([{{fullurl: {{{testcases| {{FULLPAGENAME}}/testcases }}} | action=edit&preload=Template:Documentation/preload-testcases }} create])</small> | ||
| − |        }} pages. | + |        }} pages. <br> | 
| − |      }} | + |      }}{{#if: {{{content|}}} {{{docname fed|}}} | 
| + |     |  | ||
| + |     | Add categories and interwikis to the /doc subpage. | ||
| + |     }} [[Special:PrefixIndex/{{{template page|{{FULLPAGENAME}}}}}/|Subpages of this template]]. | ||
|    }} |    }} | ||
| + | }}<!-- | ||
| + |   Detect and report strange usage: | ||
| + | -->{{#if: | ||
| + |   <!--Check if there are /doc, /sandbox and /testcases in talk space | ||
| + |       when they should be in subject space, and the other way around--> | ||
| + |   {{#ifexist:  | ||
| + |     {{{not-docspace|}}}:{{PAGENAME:{{{template page|{{FULLPAGENAME}}}}}}}/doc | ||
| + |   | strange | ||
| + |   }}{{#ifexist:  | ||
| + |     {{{not-docspace|}}}:{{PAGENAME:{{{template page|{{FULLPAGENAME}}}}}}}/sandbox | ||
| + |   | strange | ||
| + |   }}{{#ifexist:  | ||
| + |     {{{not-docspace|}}}:{{PAGENAME:{{{template page|{{FULLPAGENAME}}}}}}}/testcases | ||
| + |   | strange | ||
| + |   }} | ||
| + |   <!--Check if {{documentation}} is transcluded  | ||
| + |       on a /doc or /testcases page--> | ||
| + |   {{#switch: {{SUBPAGENAME}} | ||
| + |   | doc | ||
| + |   | testcases = strange | ||
| + |   }} | ||
| + | |||
| + | | [[Category:Wikipedia pages with strange ((documentation)) usage|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace --> | ||
| }}<noinclude> | }}<noinclude> | ||