Template:TOC numbers: Difference between revisions

From Shifti
Jump to navigation Jump to search
shamelessly ripping off Template:Loop
 
No edit summary
Line 2: Line 2:
|-
|-
|{{{type|Chapter}}}: {{#ifexpr: {{{1|0}}} > 0 |<!--  
|{{{type|Chapter}}}: {{#ifexpr: {{{1|0}}} > 0 |<!--  
   -->{{#ifexpr: {{{1}}}*2-00 > 00 |<!--
   -->{{#ifexpr: {{{1}}} > 00 |<!--
   -->{{#ifexpr: {{{1}}}*2-01 > 01 |<!--
   -->{{#ifexpr: {{{1}}} > 01 |<!--
   -->{{#ifexpr: {{{1}}}*2-02 > 02 |<!--
   -->{{#ifexpr: {{{1}}} > 02 |<!--
   -->{{#ifexpr: {{{1}}}*2-03 > 03 |<!--
   -->{{#ifexpr: {{{1}}} > 03 |<!--
   -->{{#ifexpr: {{{1}}}*2-04 > 04 |<!--
   -->{{#ifexpr: {{{1}}} > 04 |<!--
   -->{{#ifexpr: {{{1}}}*2-05 > 05 |<!--
   -->{{#ifexpr: {{{1}}} > 05 |<!--
   -->{{#ifexpr: {{{1}}}*2-06 > 06 |<!--
   -->{{#ifexpr: {{{1}}} > 06 |<!--
   -->{{#ifexpr: {{{1}}}*2-07 > 07 |<!--
   -->{{#ifexpr: {{{1}}} > 07 |<!--
   -->{{#ifexpr: {{{1}}}*2-08 > 08 |<!--
   -->{{#ifexpr: {{{1}}} > 08 |<!--
   -->{{#ifexpr: {{{1}}}*2-09 > 09 |<!--
   -->{{#ifexpr: {{{1}}} > 09 |<!--
   -->{{#ifexpr: {{{1}}}*2-10 > 10 |<!--
   -->{{#ifexpr: {{{1}}} > 10 |<!--
   -->{{#ifexpr: {{{1}}}*2-11 > 11 |<!--
   -->{{#ifexpr: {{{1}}} > 11 |<!--
   -->{{#ifexpr: {{{1}}}*2-12 > 12 |<!--
   -->{{#ifexpr: {{{1}}} > 12 |<!--
   -->{{#ifexpr: {{{1}}}*2-13 > 13 |<!--
   -->{{#ifexpr: {{{1}}} > 13 |<!--
   -->{{#ifexpr: {{{1}}}*2-14 > 14 |<!--
   -->{{#ifexpr: {{{1}}} > 14 |<!--
   -->{{#ifexpr: {{{1}}}*2-15 > 15 |<!--
   -->{{#ifexpr: {{{1}}} > 15 |<!--
   -->{{#ifexpr: {{{1}}}*2-16 > 16 |<!--
   -->{{#ifexpr: {{{1}}} > 16 |<!--
   -->{{#ifexpr: {{{1}}}*2-17 > 17 |<!--
   -->{{#ifexpr: {{{1}}} > 17 |<!--
   -->{{#ifexpr: {{{1}}}*2-18 > 18 |<!--
   -->{{#ifexpr: {{{1}}} > 18 |<!--
   -->{{#ifexpr: {{{1}}}*2-19 > 19 |<!--
   -->{{#ifexpr: {{{1}}} > 19 |<!--
   -->{{#ifexpr: {{{1}}}*2-20 > 20 |<!--
   -->{{#ifexpr: {{{1}}} > 20 |<!--
   -->{{#ifexpr: {{{1}}}*2-21 > 21 |<!--
   -->{{#ifexpr: {{{1}}} > 21 |<!--
   -->{{#ifexpr: {{{1}}}*2-22 > 22 |<!--
   -->{{#ifexpr: {{{1}}} > 22 |<!--
   -->{{#ifexpr: {{{1}}}*2-23 > 23 |<!--
   -->{{#ifexpr: {{{1}}} > 23 |<!--
   -->{{#ifexpr: {{{1}}}*2-24 > 24 | [[#1|1]] |<!--
   -->{{#ifexpr: {{{1}}} > 24 | [[#1|1]] |<!--
   -->}} |, [[#2|2]] |<!--
   -->}} |, [[#2|2]] |<!--
   -->}} |, [[#3|3]] |<!--
   -->}} |, [[#3|3]] |<!--

Revision as of 04:38, 27 September 2007

{{#ifexpr: {{{1}}} > 00 |{{#ifexpr: {{{1}}} > 01 |{{#ifexpr: {{{1}}} > 02 |{{#ifexpr: {{{1}}} > 03 |{{#ifexpr: {{{1}}} > 04 |{{#ifexpr: {{{1}}} > 05 |{{#ifexpr: {{{1}}} > 06 |{{#ifexpr: {{{1}}} > 07 |{{#ifexpr: {{{1}}} > 08 |{{#ifexpr: {{{1}}} > 09 |{{#ifexpr: {{{1}}} > 10 |{{#ifexpr: {{{1}}} > 11 |{{#ifexpr: {{{1}}} > 12 |{{#ifexpr: {{{1}}} > 13 |{{#ifexpr: {{{1}}} > 14 |{{#ifexpr: {{{1}}} > 15 |{{#ifexpr: {{{1}}} > 16 |{{#ifexpr: {{{1}}} > 17 |{{#ifexpr: {{{1}}} > 18 |{{#ifexpr: {{{1}}} > 19 |{{#ifexpr: {{{1}}} > 20 |{{#ifexpr: {{{1}}} > 21 |{{#ifexpr: {{{1}}} > 22 |{{#ifexpr: {{{1}}} > 23 |{{#ifexpr: {{{1}}} > 24 | 1 |}} |, 2 |}} |, 3 |}} |, 4 |}} |, 5 |}} |, 6 |}} |, 7 |}} |, 8 |}} |, 9 |}} |, 10 |}} |, 11 |}} |, 12 |}} |, 13 |}} |, 14 |}} |, 15 |}} |, 16 |}} |, 17 |}} |, 18 |}} |, 19 |}} |, 20 |}} |, 21 |}} |, 22 |}} |, 23 |}} |, 24 |}} |, 25 |}} | }}

This replaces the auto-generated TOC with a simple numbered table of contents for use in stories where parts are numbered but not named.

It takes one optional named parameter, "type", that defaults to "Chapter". It also has one required unnamed parameter, a number from 1 to 25, that sets the number of parts.

So for example:

{{TOC numbers|12}} for a story with 12 chapters

{{TOC numbers|type=Part|15}} for a story with 15 parts.