Difference between revisions of "Template:Txtbox"

From PC-BSD Wiki
Jump to: navigation, search
(30 intermediate revisions by one user not shown)
Line 1: Line 1:
<includeonly>{|align="center" cellspacing="1px" cellpadding="7px" style="border: none; width:98%; margin: 0 0 0 0; margin-top:10px; margin-bottom:10px; border-collapse: collapse;"
+
<includeonly>{|align="center" cellpadding="5px" style="border: none; margin-left:12px; margin-right:12px; margin-top:10px; margin-bottom:10px; border-collapse: collapse;"
|style="font-family: Courier New, Courier, monospace; border: #aaaaaa dashed 1px; background: #f6f6f6; text-align:left; width:{{{width|50%}}}; {{white-space|{{{1|}}}}} padding:0px 0px 0px 0px;"|{{{box|What did you intend to assign to box?}}}
+
|style="font-family: Courier New, Courier, monospace; border: #aaaaaa dashed 1px; background: #f6f6f6; text-align:left; width:{{{width|auto}}}; {{white-space|{{{1|}}}}} padding:5px 5px 5px 5px; {{{overrides}}}"|{{{box|What did you intend to assign to box?}}}
|style="border:none; text-align:left; padding:0px 0px 5px 0px;"|{{{txt|}}}
+
|style="border:none; text-align:left; padding:0px 5px px 5px;"|{{{txt|}}}
 
|}[[category:Uses Txtbox]]</includeonly><noinclude>
 
|}[[category:Uses Txtbox]]</includeonly><noinclude>
 
== Explanation ==
 
== Explanation ==
  
This template encloses the provided text within a dashed line box. The text to the right of the box may be some type of comment such as ''"a prompt asking for the root password will open."''. By assigning width it can be adjusted if necessary, otherwise the content to the right of the box defaults to a width of 60% out of the 98% used. Note the <nowiki><nowiki></nowiki> 'prefixed with a space' formatting trick should be avoided. Other style markup like for ''italic'' or '''bold''' should be placed directly around the specific content and not around the entire template. Individual {{pound}} symbols should be replaced with <nowiki>{{pound}}</nowiki> and a series of pound symbols may be enclosed within nowiki tags or they will be parsed as numbered list elements.
+
This template encloses the provided text within a dashed line box. The text to the right of the box may be some type of comment such as ''"a prompt asking for the root password will open."''. The effect will be shrink to fit but the width (depending upon wrap style) of the box can be adjusted if necessary. Note the <nowiki><nowiki></nowiki> 'prefixed with a space' formatting trick should be avoided. Other style markup like for ''italic'' or '''bold''' should be placed directly around the specific content and not around the entire template. Individual {{pound}} symbols should be replaced with <nowiki>{{pound}}</nowiki> and a series of pound symbols may be enclosed within nowiki tags or they will be parsed as numbered list elements.
 
=== wrap options ===
 
=== wrap options ===
: '''normal'''   = white-space: normal;   <!-- multiple white space collapses, text wraps at box border.                       -->
+
{{txtbox|override|box=
: '''wrap'''    = white-space: pre-wrap;  <!-- whitespace preserved, text wraps at box border and line breaks.                 -->
+
'''pre'''     = white-space: pre;       - DEFAULT: acts like 'pre' whitespace preserved, text wraps at box border and line breaks.
: '''wiki'''    = white-space: nowrap;    <!-- This is the brain damaged method the magic (prefix w/space) wiki text boxes use. -->
+
'''wrap'''    = white-space: pre-wrap;  - whitespace preserved, text wraps at box border and line breaks. Good for very long commands.
: '''collapse''' = white-space: pre-line;  <!-- multiple white space collapses, text wraps at box border and line breaks.       -->
+
'''wiki'''    = white-space: nowrap;    - This is the brain damaged method the magic (prefix w/space) wiki text boxes use.
: '''code'''    = white-space: pre;      <!-- used as possibly easier to remember effect.                                     -->
+
'''collapse''' = white-space: pre-line;  - multiple white space collapses, text wraps at box border and line breaks.
: '''pre'''     = white-space: pre;       <!-- <<<<< REPLACE as the default to use after txtbox locations fixed >>>>>          -->
+
'''code'''    = white-space: pre;      - easier to remember effect name.
 +
'''normal'''  = white-space: normal;    - multiple white space collapses, text wraps at box border.
 +
'''override''' = white-space: pre; border:none; background: none; (Used for this list) - use for simple 'pre' style formatting}}
  
 
== Usage ==
 
== Usage ==
  
'''<nowiki>{{</nowiki>txtbox|pre|width=''value''|box='''''content such as parens containing 5(    ) spaces preserved,''<br>
+
'''<nowiki>{{</nowiki>txtbox|''width='''value'''''|box='''''content such as parens containing 5(    ) spaces preserved,''<br>
 
<nowiki>'''</nowiki>''second line'' - <nowiki>{{</nowiki>highlight|note that bold and italic and highlight/redlight<nowiki>}}'''</nowiki><br>
 
<nowiki>'''</nowiki>''second line'' - <nowiki>{{</nowiki>highlight|note that bold and italic and highlight/redlight<nowiki>}}'''</nowiki><br>
'''|txt='''''Text to right of box''<nowiki><br></nowiki><br>
+
'''|txt='''''Text to right of box''<nowiki><br></nowiki><nowiki>''</nowiki>''second line<nowiki>''</nowiki> - <nowiki>{{</nowiki>redlight|are possible too.<nowiki>}}</nowiki>'''''}}'''
<nowiki>''</nowiki>''second line<nowiki>''</nowiki> - <nowiki>{{</nowiki>redlight|are possible too.<nowiki>}}</nowiki>'''}}'''
+
  
== Example ==
+
=== Result ===
bunch of temporary text for testing 1<br>
+
 
bunch of temporary text for testing 2
+
{{txtbox|box=content such as parens containing 5(    ) spaces preserved,
bunch of temporary text for testing 3{{txtbox|pre|box=content such as parens containing 5(    ) spaces preserved,
+
 
'''second line''' - {{highlight|note that bold and italic and highlight/redlight}}|txt=Text to right of box
 
'''second line''' - {{highlight|note that bold and italic and highlight/redlight}}|txt=Text to right of box
''second line'' - {{redlight|are possible too.}}}}</noinclude><noinclude>[[category:templates]]<!-- There must not be any spaces after this comment. padding-left: .7em; padding-right: .6em; padding-top: 1em; padding-bottom: .1em;  -->bunch of temporary text for testing 1<br>
+
''second line'' - {{redlight|are possible too.}}}}</noinclude><noinclude>[[category:templates]]<!-- There must not be any spaces after this comment. --></noinclude><noinclude>
bunch of temporary text for testing 2
+
bunch of temporary text for testing 3</noinclude>
+

Revision as of 15:41, 22 February 2013

Contents

Explanation

This template encloses the provided text within a dashed line box. The text to the right of the box may be some type of comment such as "a prompt asking for the root password will open.". The effect will be shrink to fit but the width (depending upon wrap style) of the box can be adjusted if necessary. Note the <nowiki> 'prefixed with a space' formatting trick should be avoided. Other style markup like for italic or bold should be placed directly around the specific content and not around the entire template. Individual # symbols should be replaced with {{pound}} and a series of pound symbols may be enclosed within nowiki tags or they will be parsed as numbered list elements.

wrap options

pre = white-space: pre; - DEFAULT: acts like 'pre' whitespace preserved, text wraps at box border and line breaks.

wrap = white-space: pre-wrap; - whitespace preserved, text wraps at box border and line breaks. Good for very long commands. wiki = white-space: nowrap; - This is the brain damaged method the magic (prefix w/space) wiki text boxes use. collapse = white-space: pre-line; - multiple white space collapses, text wraps at box border and line breaks. code = white-space: pre; - easier to remember effect name. normal = white-space: normal; - multiple white space collapses, text wraps at box border.

override = white-space: pre; border:none; background: none; (Used for this list) - use for simple 'pre' style formatting

Usage

{{txtbox|width=value|box=content such as parens containing 5( ) spaces preserved,
'''second line - {{highlight|note that bold and italic and highlight/redlight}}'''
|txt=Text to right of box<br>''second line'' - {{redlight|are possible too.}}}}

Result

content such as parens containing 5( ) spaces preserved, second line - note that bold and italic and highlight/redlight
Text to right of box second line -  are possible too. 
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox