Template:LiExt/doc

LiExt is an extension of Li that allows several additional options to use to make numbered lists with indentations and special text formatting. LiExt will behave exactly the same as Li when none of the additional options are used. The documentation for Li is repeated first before the extra options are explained.

Li takes a list of up to 20 string elements, together with two parameters, one which is prefixed to each element and one which is suffixed to each element.

returns

p_str ele_1 s_str p_str ele_2 s_str . . . p_str ele_n s_str

with one space added after the p_str. For example

returns

 dog  cat  mouse

The option num adds numbering starting at the value of num when set. For example

returns

1.1.1 dog 1.1.2 cat 1.1.3 mouse

Use num="" (empty quoted string) to add numbering starting at 1. For example

returns

1 dog 2 cat <li>3 mouse</li>

The options prolog and epilog prepend and append to the list.

returns

<ul> <li>1.1.1 dog</li> <li>1.1.2 cat</li> <li>1.1.3 mouse</li> </ul>

The option prefix inserts another copy of ele_i followed by prefix after p_str.

For example you may hope

returns

<li><a href="#dog">1.1.1 dog</a></li> <li><a href="#cat">1.1.2 cat</a></li> <li><a href="#mouse">1.1.3 mouse</a></li>

which does not display in wiki, but you can use

which does produce the source

<li><a href="#dog">1.1.1 dog</a></li> <li><a href="#cat">1.1.2 cat</a></li> <li><a href="#mouse">1.1.3 mouse</a></li>

This is equivalent in use to

<li>1.1.1 dog</li> <li>1.1.2 cat</li> <li>1.1.3 mouse</li>

The call

appears below.

An extra detail is that a | bar must end a line before a carraige return like

but it does not work for

The extra options are rep_i, repl_i, repr_i, nofix_i, ref_i, and vis_i.

The option rep_i replaces ele_i, the i'th member of the list, with the value of rep_i. The option repl_i replaces the prefix p_str for the i'th member of the list with the value of repl_i. The option repr_i replaces the suffix s_str for the i'th member of the list with the value of repr_i. For example, the call

will produce

The call

will produce

Setting the value of either of the options repl_i or repr_i to the empty quoted string "" will make that item an empty string. For example, the call

will result in

Setting the value of the option nofix_i to anything will disable the effect of the option prefix for the i'th element of the list. When nofix_i is set all square brackets must also be removed on the i'th element using repl_i and repr_i.

The call

appears below.

The option ref_i is used to change the terminating string in the path that is by default ele_i when the option prefix is used. If ref_i is set, then the option vis_i can also be used to change the appearance of the link to the value of vis_i. When using ref_i the extra right square brackets must be removed using repr_i. This done this way so that the value of ele_i can remain in the list.

The calls

appear below.

The html outputs are

<ul> <li><a href="#dog">1.1.1 dog</a></li> <li><a href="#horse">1.1.2 horse</a> The cat is still here!</li> <li><a href="#mouse">1.1.3 mouse</a></li> </ul>

and

<ul> <li><a href="#dog">1.1.1 dog</a></li> <li><a href="#horse">1.1.2 cat</a> The cat is still here!</li> <li><a href="#mouse">1.1.3 mouse</a></li> </ul> .