Template:Prototype TOC/doc: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (word)
(work without param)
 
Line 1: Line 1:
* Generates the full table of contents for a prototype page based on the [[Template:Prototype property|prototype properties]] set up through Semantic MediaWiki.
* Generates the full table of contents for a prototype page based on the [[Template:Prototype property|prototype properties]] set up through Semantic MediaWiki.
* The first parameter is used to set the lua prototype type name for the prototype page that this TOC is on.
* The first parameter is used to set the lua prototype type name for the prototype page that this TOC is on. It can be omitted to not set a prototype type, when the template is not used for a prototype.
* The "no-properties" named parameter should be present when the prototype has no further properties.
* The "no-properties" named parameter should be present when the prototype has no further properties.
* This prototype type is displayed above the table. The first section of the TOC shows all mandatory properties, then all optional properties and finally all inherited properties, sectioned by prototype, are displayed.
* This prototype type is displayed above the table. The first section of the TOC shows all mandatory properties, then all optional properties and finally all inherited properties, sectioned by prototype, are displayed.
Line 7: Line 7:
<pre><nowiki>__NOTOC__
<pre><nowiki>__NOTOC__
<table class="prototype-toc">
<table class="prototype-toc">
<tr><td class="caption" colspan="3">{{FULLPAGENAME}} — <code>[[Has prototype type::{{{1}}}]]</code></td></tr>
<tr><td class="caption" colspan="3">{{FULLPAGENAME}} {{#if: {{{1|}}} | — <code>[[Has prototype type::{{{1}}}]]</code> | }}</td></tr>
{{#if: {{{no-properties|}}} | <tr><td colspan="3" class="prototype-toc-item-name">No new properties</td></tr> |
{{#if: {{{no-properties|}}} | <tr><td colspan="3" class="prototype-toc-item-name">No new properties</td></tr> |
{{Prototype_TOC/section|{{FULLPAGENAME}}|optional=false}}
{{Prototype_TOC/section|{{FULLPAGENAME}}|optional=false}}

Latest revision as of 12:39, 8 August 2019

  • Generates the full table of contents for a prototype page based on the prototype properties set up through Semantic MediaWiki.
  • The first parameter is used to set the lua prototype type name for the prototype page that this TOC is on. It can be omitted to not set a prototype type, when the template is not used for a prototype.
  • The "no-properties" named parameter should be present when the prototype has no further properties.
  • This prototype type is displayed above the table. The first section of the TOC shows all mandatory properties, then all optional properties and finally all inherited properties, sectioned by prototype, are displayed.

Source code:

__NOTOC__
<table class="prototype-toc">
<tr><td class="caption" colspan="3">{{FULLPAGENAME}} {{#if: {{{1|}}} | — <code>[[Has prototype type::{{{1}}}]]</code> | }}</td></tr>
{{#if: {{{no-properties|}}} | <tr><td colspan="3" class="prototype-toc-item-name">No new properties</td></tr> |
{{Prototype_TOC/section|{{FULLPAGENAME}}|optional=false}}
{{Prototype_TOC/section|{{FULLPAGENAME}}|optional=true}}
}}
{{#ask: [[Has parent ::+]][[{{FULLPAGENAME}}]]
 |?Has parent
 |format=plainlist
 |mainlabel=-
 |template=Prototype TOC/parent
 |link=none
}}
</table>

This template depends on the following subtemplates: