Difference between revisions of "Template:ModelDocumentationTemplate"

From IAMC-Documentation
Jump to: navigation, search
 
(7 intermediate revisions by 2 users not shown)
Line 6: Line 6:
 
|IsDocumentationOf=
 
|IsDocumentationOf=
 
|DocumentationCategory=
 
|DocumentationCategory=
|HasLevel
 
|HasSeq
 
|HasParent
 
 
|isEmpty
 
|isEmpty
 
}}
 
}}
 
</pre>
 
</pre>
 
Edit the page to see the template text.
 
Edit the page to see the template text.
</noinclude><includeonly>{| style="width: 30em; font-size: 90%; border: 1px solid #aaaaaa; background-color: #f9f9f9; color: black; margin-bottom: 0.5em; margin-left: 1em; padding: 0.2em; float: right; clear: right; text-align:left;"
+
</noinclude><includeonly>{{#ifeq:{{#show:{{PAGENAME}}|? IsInPrintMode}}|true||
! style="text-align: center; background-color:#ccccff;"  colspan="2"|<span style="font-size: larger;">{{#ask:[[HasLevel::0]][[IsDocumentationOf::<q>[[-IsDocumentationOf::{{PAGENAME}}]]</q>]]}}</span>
+
{{ProcessStateTemplate|model={{#show:{{PAGENAME}}|? IsDocumentationOf|link=none}} }}
|-
+
{{ModelInfoBoxesTemplate}}
| colspan="2"|{{#arraymap:
+
 
  {{#ask:[[HasLevel::0]][[IsDocumentationOf::<q>[[-IsDocumentationOf::{{PAGENAME}}]]</q>]]|link=none|sep=;}}
+
[[Category:{{{DocumentationCategory|}}}]]
  |;|x0
+
{{#set:
  |<ul>{{#arraymap:
+
IsDocumentationOf={{{IsDocumentationOf|}}}  
    {{#ask:[[HasParent::x0]]|? HasSequence-|link=none|sep=;|sort=HasSequence|format=list}}
+
|IsOptional={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?IsOptionalCategory=|mainlabel=-}}  
    |;|x1
+
|HasLevel={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategoryLevel=|mainlabel=-}}
    |{{#ifexpr:{{#ask:[[HasParent::x1]]|format=count}}=0 <!--no children
+
|HasSequence={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategorySequence=|mainlabel=-}}  
      -->|<li>[[x1]]</li><!-- no children then just show, else class mw_collapse determination
+
}}{{#ifeq:
      -->|{{#ifeq:{{PAGENAME}}|x0  <!-- actual page is x0 (root of tree) -->
+
    {{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategoryLevel=|mainlabel=-}}|0|
          |<div class="mw-collapsible mw-collapsed">
+
     |{{#arraymap:{{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?Subcategory of=|mainlabel=-|link=none|valuesep=;}}|;|xx
          |{{#ifeq:{{PAGENAME}}|x1 <!--actual page is  x1 -->
+
             |{{#set:HasParent=xx - {{{IsDocumentationOf|}}} }}
            |<div class="mw-collapsible">
+
    |}}  
            |{{#ifeq:{{#ask:[[-HasParent::{{PAGENAME}}]]|link=none }}|x1 <!--actual page is child of x1 -->
+
}}{{#ifeq:
                |<div class="mw-collapsible">
+
    {{{IsEmpty|}}}||{{#set:IsEmpty=No}}|{{#set:IsEmpty={{{IsEmpty|}}} }} }}
                |{{#ifeq:{{#ask:[[-HasParent.-HasParent::{{PAGENAME}}]]|link=none }}|x1 <!-- actual page is grandchild of x1-->
+
}}</includeonly>
                  |<div class="mw-collapsible">
 
                  |<div class="mw-collapsible mw-collapsed">
 
                  }} <!-- actual page is grandchild  -->
 
              }}<!-- actual page is child -->
 
          }} <!--actual page is  x1 -->
 
          }}  <!--
 
      --><li>[[x1]]</li><!--
 
      --><div class="mw-collapsible-content"><!--
 
      --><ul>{{#arraymap:
 
            {{#ask:[[HasParent::x1]]|? HasSequence-|link=none|sep=;|sort=HasSequence|format=list}} 
 
            |;|x2
 
            |{{#ifexpr:{{#ask:[[HasParent::x2]]|format=count}}=0 <!--no children         
 
            -->|<li>[[x2]]</li> <!-- no children then just show, else class mw_collapse determination
 
            -->|{{#ifeq:{{PAGENAME}}|x1  <!-- actual page is parent  -->
 
                  |<div class="mw-collapsible mw-collapsed">
 
                  |{{#ifeq:{{PAGENAME}}|x2 <!--actual page is  x2 -->
 
                      |<div class="mw-collapsible">
 
                      |{{#ifeq:{{#ask:[[-HasParent::{{PAGENAME}}]]|link=none}}|x2 <!--actual page is child of x2 -->
 
                        |<div class="mw-collapsible"> 
 
                        |<div class="mw-collapsible mw-collapsed">                   
 
                      }}<!-- actual page is child -->
 
                    }} <!--actual page is  x1 -->
 
                }}<!--
 
              --><li>[[x2]]</li><!--
 
              --><div class="mw-collapsible-content"><!--
 
              --><ul>{{#arraymap:
 
                  {{#ask:[[HasParent::x2]]|? HasSequence-|link=none|sep=;|sort=HasSequence|format=list}}
 
                  |;|x3
 
                  |<li>[[x3]]</li>
 
                |}}</ul></div></div> <!--closing the second level collapse -->
 
              }} <!-- end of second level children  -->         
 
          |}}</ul></div></div> <!--closing the first level collapse -->
 
        }} <!-- end of first level children  --> 
 
    |}}</ul> <!-- end x0 is root  --> 
 
  |}} <!-- end -->
 
|-
 
! style="text-align: center; background-color:#ccccff;"  colspan="2"|<span style="font-size: larger;">Corresponding documentation</span>
 
|-
 
| colspan="2"|
 
{{CorrespondingPageTemplate
 
  |{{#show:{{PAGENAME}}|? HasLevel}}
 
  |{{#show:{{PAGENAME}}|? HasSequence}}
 
  }}
 
|-
 
! style="text-align: center; background-color:#ccccff;" colspan="2"|<span style="font-size: larger;">Model information</span>
 
|-
 
! style="width:7em; vertical-align: text-top;"| Institution
 
| {{#ask:[[-isDocumentationOf::{{PAGENAME}}]]|? HasInstitution=|mainlabel=-}}
 
|-
 
! style="vertical-align: text-top;"|Concept
 
| {{#ask:[[Category:Model]][[-isDocumentationOf::{{PAGENAME}}]]|? HasConcept=|mainlabel=-}}
 
|-
 
! style="vertical-align: text-top;"|Solution method
 
| {{#ask:[[Category:Model]][[-isDocumentationOf::{{PAGENAME}}]]|? HasSolutionMethod=|mainlabel=-}}
 
|-
 
! style="vertical-align: text-top;"|Anticipation
 
| {{#ask:[[Category:Model]][[-isDocumentationOf::{{PAGENAME}}]]|? HasAnticipation=|mainlabel=-}}
 
|}
 
[[Category:{{{DocumentationCategory|}}}]]<!--
 
-->{{#set:IsDocumentationOf={{{IsDocumentationOf|}}} }}<!--
 
-->{{#set:IsOptional={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?IsOptionalCategory=|mainlabel=-}} }}<!--
 
-->{{#set:HasLevel={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategoryLevel=|mainlabel=-}} }}<!--
 
-->{{#set:HasSequence={{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategorySequence=|mainlabel=-}} }}<!--
 
-->{{#ifeq:{{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?HasCategoryLevel=|mainlabel=-}}|0|<!--
 
     -->|{{#arraymap:{{#ask:[[:Category:{{{DocumentationCategory|}}}]]|?Subcategory of=|mainlabel=-|link=none|sep=;}}|;|xx<!--
 
             -->|{{#set:HasParent=xx - {{{IsDocumentationOf|}}} }}<!--
 
      -->|}} }}<!--
 
-->{{#ifeq:{{{IsEmpty|}}}||{{#set:IsEmpty=No}}|{{#set:IsEmpty={{{IsEmpty|}}} }} }}</includeonly>
 

Latest revision as of 10:37, 27 May 2020

This is the "ModelDocumentationTemplate" template. It should be called in the following format:

{{ModelDocumentationTemplate
|IsDocumentationOf=
|DocumentationCategory=
|isEmpty
}}

Edit the page to see the template text.