Template:Cl-act-p

From Wikisource
(Redirected from User:JustinCB/cl-act-p)
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

Cl-act-p[edit]

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[edit]

  • 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 text or cont 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 & 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[edit]

default
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
left
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
rlpage
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
lrpage
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
right
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Test higher level:

default
1. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
default
2.—(1) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
default
(2) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
default
(a) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
default
(i) Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

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

default
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

default
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Higher level cl-act-p templates[edit]

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[edit]

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 —
  • index-style = {{cl-act-p/indexstyle}} format for all other level section numbers.

Cl-act-p/indexstyle[edit]

Helper template for formatting the numbers on paragraphs in various legislation. Called from higher level templates.


Usage[edit]

{{cl-act-p/indexstyle|number|format}}

Parmeters[edit]

  • number The number or text string to be formatted.
  • format The number or text string to be formatted. The formatting code to apply. Currently supported are
lower-alphab (a)
numeric 1
numerica (1)
numericb (1)
numericc (1)
smallcapsa Aa
smallcapsb (Aa)
fwb 1
fsi 1
roman I
ul 1
  • The default format is numerica
  • Typically this template is called from a higher level



cl-act-style[edit]

{{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[edit]

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

cl-act-begin[edit]

Used internally to begin the paragraph

cl-act-body[edit]

Used internally to handle the text, pre-text &c of the paragraph

cl-act-finish[edit]

Used internally to end the paragraph.

cl-act-h[edit]

This template was made as a replacement for cl-act-title, and it generates a side title using {{MarginNote}} and uses several of the {{cl-act-p}} arguments to put itself in the proper place. Test:

A test side note.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
A test side note.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Code for test:

<div style="margin-left:8em;margin-right:8em;">
{{cl-act-h||A test side note.}}{{lorem ipsum}}

{{cl-act-h|layout=left|title=A test side note.}}{{lorem ipsum}}
</div> 

cl-act-h/1[edit]

Usage[edit]

  • 1 - Subject line
  • 2 - Part/section number. If used specify style and 1 as the subject. Used in generating an acnhor.
  • sch - Schedule number.
  • title - Side title to use.
  • style -
    • {ilchap} - Indian Legislation style chapter heading, 2 is the chapter number.
    • {roman} - Small caps Part X, Smallcaps Subject. X is converted to roman neumerals.
    • {roman2} - Small caps Part X, italic Subject. X is converted to roman neumerals.
    • {roman3} - Upper case Part X, Upper case Subject line. X is converted to roman neumerals.
    • {none} or default is uppercase bold Part X, uppercase bold subject line



cl-act-h/1-body[edit]

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[edit]

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

cl-act-h/2[edit]

Creates a centred italic heading for use in various legislation.

Usage[edit]

  • 1 - Text/subject of heading
  • 2 -[optional] Additional text such as Section/Part. If used use 1 to specify the subject line. {{cl-act-h/2|1096|Battle}} would give a heading with the text "Battle. 1096"(without the quotes of course).
  • title - Side-title to place at the side.
  • anchor - Anchor id to use for the heading. Default is the text of the heading, as generated by the 2 arguments above.
  • layout - Layout {left|right|etc..} placement of side-title(Passed through to {{cl-act-p}} template used to render these). See the layout information above.



cl-act-preamb[edit]

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 {{#invoke:}}[edit]

The cl-act family of templates is partially written in lua. You can use them via {{#invoke:}}. 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, {{cl-act-p/1/s}} is equivalent to {{#invoke:cl-act|p_1_s}} and {{cl-act-h/1}} is equivalent to {{#invoke:cl-act|h_1}}. The current reccomendation is to use normal transclusion syntax. The top level template {{cl-act}} can be invoked with {{#invoke:cl-act|cl-act}} not {{#invoke:cl-act}}.





Calling from other lua modules[edit]

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 & the function names are the same as with {{#invoke:}}.