Template:Cl-act-p/doc

Cl-act-p
This template is designed to assist in formating items of commonwealth legislation. It has /s /c and /e variants for starting continuing and ending. Unless otherwise noted, its subtemplates do not have them.

This template should be used for paragraphs of legislation.

Paramaters

 * split= {start|end|cont|table|heading} - optional - used to mark the start, end or continuation of a section over a page break
 * start = Marks the start of a paragraph. - Use this at the start of a paragraph extending over a Page: break
 * cont = Marks the continuation of a parahraph - Use this at the 'continuation' of a paragraph from a previous Page:
 * end = marks the end of a paragraph. - Use this to mark the end of a paragraph.
 * heading = The content is a heading, sub heading, section or part title. Currently passes the text parameter directly into output.
 * table = The content is a tabular data - Currently passes the text parameter directly into output.
 * footer = The contents, of the or  parameter(s) represent "footer" content, which is only displayed in the page namespace.
 * layout= {left|right|lrpage|rlpage} - optional (default:right) - Specfies if side titles are on the left or right hand side.
 * left: left side titles
 * right: right side titles
 * lrpage left side titles in page namespace, right side titles when transcluded
 * rlpage right side titles in page namespace, left side titles when transcluded
 * title= Side title for the section - (Additional side titles can be inserted in the text using cl-act-h ). Due to technical limitations this cannot contain any DIV based formatting, or formatting which adjusts margins.
 * text= The text of the section. You can also place the text between a /s and /e variant.
 * cont= (optional) continutation text to place at base of page &amp; only shew in page namespace. (This only valid for a split=end or /e variant of the template).
 * section= (optional) Section number or index. (On higher level templates this is automatically generated)
 * anchor= Section anchor for URL's (On higher level templates this is automatically generated)
 * adjust= Margin adjustment for sub-level sections
 * indent= Amount of indentation to apply for this section.
 * leading= Amount of additional whitespace to add at end of section.
 * pretext= (Optional and Experimental) Character to place before the section number. (Doesn't always look good with certain other templates.)

Tests
Test higher level:

The 1st arrangement has a newline before cl-act-p/c &amp; the second doesn't:

Higher level cl-act-p templates
All have /s /c and /e variants. The templates are (not including the aforementioned variants):
 * cl-act-p/1
 * First level paragraph
 * cl-act-p/1-2
 * First level paragraph which immediately begins with a second level paragraph.
 * cl-act-p/2
 * Second level paragraph with a numeric section index.
 * cl-act-p/2a
 * Second level paragraph with an alphabetic section index.
 * cl-act-p/3
 * Third level paragraph
 * cl-act-p/4
 * Fourth level paragraph  (for paragraphs lower than this, you will need to set up section and anchor manually, as well as any relevant indentation.)
 * cl-act-p/x
 * Doesn't display a section number, but does create an anchor based on provided section numbers. You can supply the anchor manually to override the automatically created section-number anchor.

Arguments
The templates also take the arguments that cl-act-p takes.
 * Sch = Schedule index (recommended style is Sch{x})
 * s1-s4 = Section numbers (numerical): you must pass all appropriate section numbers to their subsections for the anchor to be generated properly, that is, cl-act-p/4 still needs s1, s2, and s3 to generate the proper anchor.
 * style = cl-act-p/indexstyle format for first level section number in cl-act-p/1 and cl-act-p/1-2 in their starting variants.
 * dash = charactor to use for the dash in cl-act-p/1-2. Default is &mdash;
 * index-style = cl-act-p/indexstyle format for all other level section numbers.

cl-act-style
cl-act-style generates inline css that the cl-act templates use. You can pass additional styles to it using the style parameter. It uses most of the cl-act-p arguments.

cl-act-layout
The layout parameter to cl-act-layout is processed. It gives either left or right.

cl-act-begin
Used internally to begin the paragraph

cl-act-body
Used internally to handle the text, pre-text &amp;c of the paragraph

cl-act-finish
Used internally to end the paragraph.

cl-act-h/1-body
Generates the body text of cl-act-h/1, which cl-act-h/1 wraps with cl-act-p for display.

cl-act-h/1-style
creates the inline style used by cl-act-h/1-body

cl-act-preamb
Takes most of the same arguments as cl-act-p does, but is designed to be used for preamble. It has /s /c and /e variants. The default side title is "Preamble" instead of "".

Using with
The cl-act family of templates is partially written in lua. You can use them v ia. To do so, you prefix the template name with "#invoke:"(without the quotes), replace the dash immediately after cl-act with a pipe(|), and replace all slashes and all other dashes with underscores. So, is equivalent to  and  is equivalent to. The current reccome ndation is to use normal transclusion syntax. The top level template cl-act can be invoked wi th not.

Calling from other lua modules
To call from other lua modules, you first need to require it, then you either use the call function in the module or use frame:newChild and call the function directly. See Module:cl-act/test for an example &amp; the function names are the same as wi th.