Template:Block indent/doc: Difference between revisions
(Created page with "{{Documentation subpage}} {{tsh|bi}} {{Uses TemplateStyles|Template:Block indent/styles.css}} __NOTOC__ {{tl|block indent}} adds a block of indented text to a page. == Usage == :{{tji|block indent|1: The material to be indented here. May include markup, paragraph breaks, etc.}} ===Alternatives that are not recommended=== A colon at the start of the line produces a similar indent, but it produces incorrect HTML. (An initial <code>:</code> was intended only for use aft...") |
m (→TemplateData) |
||
Line 40: | Line 40: | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": " | "description": "Adds a block of indented text to a page.", | ||
"params": { | "params": { | ||
"1": { | "1": { |
Revision as of 21:25, 11 August 2023
It contains usage information, categories and other content that is not part of the original template page.
|
This template uses TemplateStyles: |
{{block indent}} adds a block of indented text to a page.
Usage
- {{block indent
|1=The material to be indented here. May include markup, paragraph breaks, etc.}}
Alternatives that are not recommended
A colon at the start of the line produces a similar indent, but it produces incorrect HTML. (An initial :
was intended only for use after ;
, in constructing description lists, but most editors have used it almost everywhere for indenting.)
{{block indent}} supports paragraph breaks using <p>...</p>
around second and subsequent paragraphs, as well as other HTML markup, and it is always safest to explicitly format with HTML rather than rely on MediaWiki's parser to do the right thing, because the developers could alter its behavior at any time.
Example
{{block indent|1=Lorem ipsum dolor sit amet, consectetur adipiscing 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.}}
produces:
Parameters
|1=
a.k.a.|text=
- The material to be indented. It is always safest to explicitly define this with
1=
, not as an unnamed parameter, because any occurrence (e.g. in a URL, template, etc.) of the=
character will break the template without it.
|left=
a.k.a.|em=
- the value (e.g. 0.1 or 7) in
em
units by which to indent the material from the left; defaults to3
|right=
- the value, also in
em
, by which to indent the material from the right; defaults to0
(use 7 to match the default left indentation)
|style=
- arbitrary CSS declarations, e.g.
font-size: 95%;
. This parameter should not normally be needed. Note: It already includesoverflow: hidden;
by default, to avoid collision of the div's background with floating elements.
|class=
- any CSS class names, comma-separated if more than one. This parameter should not normally be needed.
See also
- {{indent}}, which indents a single line, after a newline, using a mixture of en- and em-dash sized spaces
- {{space}}, which indents a single line (or content inline in one) uses non-breaking spaces
TemplateData
Adds a block of indented text to a page.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Text | 1 text | The material to be indented. | String | required |
Left Indent | left em | the value in em units by which to indent the material from the left.
| Number | optional |
Right Indent | right | The value in em by which to indent the material from the right.
| Number | optional |
CSS Style | style | Arbitrary CSS declarations. | String | optional |
CSS Class | class | Any CSS class names. | String | optional |