Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Block indent

Permanently protected template
From Wikipedia, the free encyclopedia

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.

Template documentation[view] [edit] [history] [purge]
WarningThis template is used in system messages, and onapproximately 1,100,000 pages, or roughly 2% of all pages.
Changes to it can cause immediate changes to the Wikipedia user interface.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Please discuss changes on thetalk page before implementing them.
CSSThis template usesTemplateStyles:
Block indentations perMOS:BQ
Use caseTemplate
Actual quotations{{Blockquote}}
w/ line breaks{{Poem quote}}
Non-quotations{{Block indent}}
Inline non-quotations{{in5}}
Math formulaSeehere

Usage

{{block indent}} adds a block of indented text to a page.

{{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. SeeMOS:INDENT. (An initial: was intended only for use after;, in constructingdescription lists, but most editors have used it almost everywhere for indenting.)

{{Blockquote}} is for actual quotations only. Using it for block indent is not correctsemantic HTML, and the appearance differs. ({{Blockquote}} produces the HTML<blockquote>...</blockquote> element, which indicates ablock quotation;{{block indent}} produces an HTML<div>...</div> element with padding on the left.)

The default display of{{block indent}} differs from that of{{Blockquote}} in that it does not:

  • introduce whitespace margins above or below the indented material (just add a blank line above and/or below manually); nor
  • indent from the right as well as the left (there is an optional parameter for this); nor
  • affect the font size of its contents; nor
  • (on mobile) bookend the block with large quotation marks; nor
  • support plain blank-line paragraph breaks inside it; nor
  • support attribution parameters (because{{block indent}} isn't for quotations).

{{Blockquote}} and{{block indent}} both support 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}}}}

produces:

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.

Parameters

|1= a.k.a.|text= The material to be indented.It is always safest to explicitly define this with1=, 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 or7) inem units by which to indent the material from the left; defaults to3

|right= the value, also inem, by which to indent the material from the right; defaults to0 (use7 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 (e.g. as defined atMediaWiki:Common.css), comma-separated if more than one. This parameter should not normally be needed.

Comparison with{{Blockquote}} (block quotation)

{{Block indent}}{{Blockquote}}
{{Lorem ipsum}}{{block indent|1={{Lorem ipsum}}{{Lorem ipsum}}}}{{Lorem ipsum}}{{Lorem ipsum}}{{Blockquote|1={{Lorem ipsum}}{{Lorem ipsum}}}}{{Lorem ipsum}}

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.

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.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.

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.

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.

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.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.

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.

Technical issues with block templates

If the block-formatted content uses anamed parameter (including|1=) and begins with a list (or any other wikimarkup that is dependent upon a specific markup character being at the beginning of a line), becauseMediaWiki behavior is to strip whitespace from named parameters, a<nowiki /> and a new line must exist before the list (or whatever) starts. This no longer affectsunnamed parameters. Compare:

 coderesult
Works as intended{{Block indent|
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
  • Firstly, ...
  • Secondly, ...
  • Thirdly, ...
FAIL{{Block indent|1=
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
*Firstly, ...
  • Secondly, ...
  • Thirdly, ...
Works as intended{{Block indent|1=<nowiki />
*Firstly, ...
*Secondly, ...
*Thirdly, ...
}}
  • Firstly, ...
  • Secondly, ...
  • Thirdly, ...

To embed a table in block markup like this, the block template's content parameter must be named or numbered and include the self-closing nowiki – as in|1=<nowiki /> – then every| character in the table markup must be escaped with {{!}}. An alternative is to use explicit HTML<table>,<tr>,<th>, and<td> markup.

See also

  • {{indent}}, which indents a single line, after a newline, using a mixture of en- and em-sized spaces
  • {{spaces}}, which indents a single line (or content inline in one) uses non-breaking spaces
  • {{in5}}, which indents a single line (or content inline in one), skipping up to fifty equal en-sized spaces
  • {{hanging indent}}, the block hanging indent template
  • {{Blockquote}}, the block quotation template, which is only for quotations
Template  Example output  Use 
{{strong}}Important! To indicate<strong> importance, seriousness, or urgency instead of just simple typographical boldfacing
{{strongbad}} "Never use ..." Same as {{strong}} but in red
{{stronggood}} "Only use ..." Same as {{strong}} but in green
{{em}} "Anemphatic phrase" To indicate<em> stress emphasis (not just purely typographical italicization like for book titles or foreign terms)
{{var}}strPrefix To indicate text is a variable name. Use for any variable names except those including "I" (uppercase i) and/or "l" (lowercase L); for these, {{var serif}} should be used to ensure a noticeable distinction
{{var serif}}strIllustratePrefix (see {{var}} above)
{{tld}}{{DEFAULTSORT:Y, X}} To display wikicode variables andmagic words as they would appear in code
{{para}}|year=2008 To display template parameters with or without values
{{param}}{{{title|alt}}} To display parameters as used in code (i.e. with triple braces), especially to indicate relationships between them. May be combined with {{para}} above
{{tjp}}|selfref=yes To display template parameters with colors (as they would appear in the{{tj}} and{{tji}} templates)
{{param value}}··2·blanks·fore·and·aft·· To display parameter values lightly bordered; replaces <code>...</code>, especially when value contains embedded or leading/trailing blanks; visualized here withmiddot (·) but can use ␠, ▯, or any character.
{{tlx}} etc.{{Template|1|2|...|10}} To display a template call (with or without parameters and values) as code
{{tji}}{{hatnote|Hello|selfref=yes|category=no}} To showcase with colors in horizontal format the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{tag}}"The<img>...</img> tags ..." To renderHTML elements ("tags") in prose
{{code}}/{{codett}}"Ensure thealt= parameter ..." To indicate text is source code. To nest other templates within {{code}}, use<code>...</code>.{{codett}} differs only in styling:someMethod becomessomeMethod
{{PreCode}}"FORTH has keyword?BRANCH." Like {{code}}, but prevents line breaks inside the code. Only for very short code parts.
{{subst:codenowiki}}{{small|small text example}} To wrap example code in<code><nowiki>...</nowiki></code>
{{subst:kbdnowiki}}{{large|large text example}} To wrap example code in<kbd><nowiki>...</nowiki></kbd>
{{syntaxhighlight}}    [this is a block template] ( or{{sxhl}})  Wrapper for<syntaxhighlight>...</syntaxhighlight>, but will wrap overflowing text
{{deprecated code}} "Do not use<blink>." ( or{{dc}})  To indicatedeprecated source code in template documentation, articles on HTML specs, etc. The{{dc2}} variant uses strike-through (<blink>) while{{dcr}} uses red (<blink>).
{{pre}}    [this is a block template] For larger blocks of source code and other pre-formatted text
{{tj}}    [this is a block template] To showcase with colors and multiple lines (vertical format) the syntax of any template, while providing an easy way to display placeholder texts using colons as separators
{{quote}}    [this is a block template] For block quotations (only – never for non-quotations)
{{block indent}}    [this is a block template] For indented blocks of material; visually identical to{{quote}} but without quote markup
{{kbd}}user input To indicate user input
{{key press}}Ctrl+x To indicate specific-keystroke input, including combinations
{{key top}}Left shift Similar; includes more symbols, but does not directly support combinations
{{button}}Don't save To indicate a button in a user interface
{{samp}}example output To indicate sample or example output
The abovedocumentation istranscluded fromTemplate:Block indent/doc.(edit |history)
Editors can experiment in this template'ssandbox(edit |diff) andtestcases(edit) pages.
Add categories to the/doc subpage.Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Block_indent&oldid=996645830"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp