Difference between revisions of "Template:Flatlist/doc"

From blackwiki
Jump to navigation Jump to search
imported>Edokter
imported>Sardanaphalus
(layout tweaks, added redirected alternate)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
 +
{{TOClimit|3}}
  
 
===Usage===
 
===Usage===
{{tl|Flatlist}} starts a horizontal list, such as:
+
{{tl|flatlist}} starts a horizontal list, such as:
 
{{flatlist}}
 
{{flatlist}}
 
* [[cat]]
 
* [[cat]]
Line 12: Line 13:
 
* [[pig]]
 
* [[pig]]
 
{{endflatlist}}
 
{{endflatlist}}
The bottom margin is inherited from the current container. Normally this will be 0.5em. This template can be used with or without {{tl|endflatlist}}.
+
The bottom margin is inherited from the current container. Normally this will be 0.5[[Em (typography)|em]]. This template can be used with or without {{tl|endflatlist}}.
  
 
For navigation boxes using {{tl|navbox}}, one can set {{para|listclass|hlist}}, and achieve the same styling without using this template.
 
For navigation boxes using {{tl|navbox}}, one can set {{para|listclass|hlist}}, and achieve the same styling without using this template.
  
For image captions, * markup does not work, so consider using {{tl|hlist}} instead.
+
For image captions, * (i.e. asterisk) markup does not work, so consider using {{tl|hlist}} instead.
  
 
===Examples===
 
===Examples===
<pre><nowiki>
+
<div style="padding-bottom:1.0em;">
 +
<pre>
 
{{flatlist|
 
{{flatlist|
 
* [[cat]]
 
* [[cat]]
Line 28: Line 30:
 
* [[pig]]
 
* [[pig]]
 
}}
 
}}
</nowiki></pre>
+
</pre>
 
+
produces:
 
{{flatlist|
 
{{flatlist|
 
* [[cat]]
 
* [[cat]]
Line 38: Line 40:
 
* [[pig]]
 
* [[pig]]
 
}}
 
}}
 +
</div>
  
;Alternative syntax:
+
====Alternative syntax====
<pre><nowiki>
+
<div style="padding-bottom:1.0em;">
{{flatlist}}
+
<pre>
 +
{{flatlist}}  or  {{startflatlist}}
 
* [[cat]]
 
* [[cat]]
 
* [[dog]]
 
* [[dog]]
Line 49: Line 53:
 
* [[pig]]
 
* [[pig]]
 
{{endflatlist}}
 
{{endflatlist}}
</nowiki></pre>
+
</pre>
 
+
produces:
 
{{flatlist}}
 
{{flatlist}}
 
* [[cat]]
 
* [[cat]]
Line 59: Line 63:
 
* [[pig]]
 
* [[pig]]
 
{{endflatlist}}
 
{{endflatlist}}
 +
</div>
  
;Syntax for ordered lists:
+
====Syntax for ordered lists====
<pre><nowiki>
+
<div style="padding-bottom:1.0em;">
{{flatlist|
+
<pre>
 +
{{startflatlist}}
 
# [[first]]
 
# [[first]]
 
# [[second]]
 
# [[second]]
Line 69: Line 75:
 
# [[fifth]]
 
# [[fifth]]
 
# [[sixth]]
 
# [[sixth]]
}}
+
{{endflatlist}}
</nowiki></pre>
+
</pre>
 
+
produces:
{{flatlist|
+
{{startflatlist}}
 
# [[first]]
 
# [[first]]
 
# [[second]]
 
# [[second]]
Line 79: Line 85:
 
# [[fifth]]
 
# [[fifth]]
 
# [[sixth]]
 
# [[sixth]]
}}
+
{{endflatlist}}
 +
</div>
  
 
===Parameters===
 
===Parameters===
* '''class''' adds a CSS class to the containing div. Use <tt>nowraplinks</tt> to prevent links from wrapping.
+
* '''''class''''' adds a CSS class to the containing div. Use <tt>nowraplinks</tt> to prevent links from wrapping.
* '''style''' adds CSS style options. Complex styles should not be used in articles (per [[wp:deviations]]) but may be acceptable on user, project, and talk pages.
+
* '''''style''''' adds CSS styling. Complex styles should not be used in articles (per [[WP:Deviations]]) but may be acceptable on user, project and talk pages.
 
::Example: {{para|<var>style</var>|<var>border:solid 1px silver; background:lightyellow</var>}}
 
::Example: {{para|<var>style</var>|<var>border:solid 1px silver; background:lightyellow</var>}}
* '''indent''' indents the list by a number of standard indents (one indent being 1.6em), particularly handy for inclusion in an indented discussion thread.
+
* '''''indent''''' indents the list by a number of standard indents, one indent being 1.6[[Em (typography)|em]]. (Useful in an indented discussion thread.)
 
::Example: {{para|<var>indent</var>|<var>2</var>}}
 
::Example: {{para|<var>indent</var>|<var>2</var>}}
  
 
===Technical details===
 
===Technical details===
This template uses the <code>.hlist</code> CSS class defined in Common.css to generate horizontal lists. It causes ordinary html list items to be displayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the interpuncts between list items and parentheses around nested lists. Some of the CSS used is not compatible with all browsers, notably Internet Explorer 6 and 7. In these cases, JavaScript in Common.js generates the interpuncts and parentheses.
+
This template uses the <code>.hlist</code> CSS class defined in Common.css to generate horizontal lists. It causes ordinary html list items to be displayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the [[interpunct]]s between list items and parentheses around nested lists. Some of the CSS used is not compatible with all browsers, notably Internet Explorer 6 and 7. In these cases, JavaScript in Common.js generates the interpuncts and parentheses.
  
 
===See also===
 
===See also===
Line 101: Line 108:
 
* [[WP:HLIST]]
 
* [[WP:HLIST]]
  
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
+
<includeonly>
[[Category:Typing-aid templates|Flatlist]]
+
{{#ifeq:{{SUBPAGENAME}}|sandbox |
[[Category:Wikipedia list formatting templates|Flatlist]]
+
| [[Category:Typing-aid templates]] [[Category:Wikipedia list formatting templates]]
}}</includeonly>
+
}}
 +
</includeonly>

Revision as of 14:05, 16 March 2014

Template:TOClimit

Usage

{{flatlist}} starts a horizontal list, such as:

The bottom margin is inherited from the current container. Normally this will be 0.5em. This template can be used with or without {{endflatlist}}.

For navigation boxes using {{navbox}}, one can set |listclass=hlist, and achieve the same styling without using this template.

For image captions, * (i.e. asterisk) markup does not work, so consider using {{hlist}} instead.

Examples

{{flatlist|
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
}}

produces:

Alternative syntax

{{flatlist}}  or  {{startflatlist}}
* [[cat]]
* [[dog]]
* [[horse]]
* [[cow]]
* [[sheep]]
* [[pig]]
{{endflatlist}}

produces:

Syntax for ordered lists

{{startflatlist}}
# [[first]]
# [[second]]
# [[third]]
# [[fourth]]
# [[fifth]]
# [[sixth]]
{{endflatlist}}

produces: Template:Startflatlist

  1. first
  2. second
  3. third
  4. fourth
  5. fifth
  6. sixth

Parameters

  • class adds a CSS class to the containing div. Use nowraplinks to prevent links from wrapping.
  • style adds CSS styling. Complex styles should not be used in articles (per WP:Deviations) but may be acceptable on user, project and talk pages.
Example: |style=border:solid 1px silver; background:lightyellow
  • indent indents the list by a number of standard indents, one indent being 1.6em. (Useful in an indented discussion thread.)
Example: |indent=2

Technical details

This template uses the .hlist CSS class defined in Common.css to generate horizontal lists. It causes ordinary html list items to be displayed inline (horizontally), where they would normally display as block elements (vertically). The class also generates the interpuncts between list items and parentheses around nested lists. Some of the CSS used is not compatible with all browsers, notably Internet Explorer 6 and 7. In these cases, JavaScript in Common.js generates the interpuncts and parentheses.

See also