Difference between revisions of "Template:Txtbox"

From PC-BSD Wiki
Jump to: navigation, search
 
(55 intermediate revisions by one user not shown)
Line 1: Line 1:
<includeonly>{| class="txtbox" style="{{#if: {{{margin-left|}}}|margin-left:{{{margin-left}}};|}} {{#if: {{{margin-right|}}}|margin-right:{{{margin-right}}};|}} {{#if: {{{margin-top|}}}|margin-top:{{{margin-top}}};|}} {{#if: {{{margin-bottom|}}}|margin-bottom:{{{margin-bottom}}};|}}"
+
<includeonly><div class=txtbox style="{{{tbstyle|}}}">
|-
+
<div class=txtbox_box style="{{white-space|{{{1|}}}}}">{{{box|need box}}}</div><div class=txtbox_txt >{{{txt|}}}</div>
|<span class="txtbox" style="{{#if: {{{width|}}}|width:{{{width}}};|}} {{white-space|{{{1|}}}}} {{{overrides|}}}">{{{box|where is your box?}}}</span>
+
</div></includeonly><noinclude>
{{#if: {{{txt|}}}|{{!}}style="text-align:{{{txt-text-align|left}}}; {{{txt-padding-left|5px}}};"{{!}}{{{txt|}}}|}}
+
|}[[category:Uses Txtbox]]</includeonly><noinclude>
+
 
== Explanation ==
 
== Explanation ==
 
{|class="{{{class|spiffy_table}}}" style="margin-left:{{{margin-left|10px}}}; margin-right:{{{margin-right|10px}}}; margin-top:{{{margin-top|10px}}}; margin-bottom:{{{margin-bottom|10px}}}; {{{other|}}}" width="{{{width|97%}}}" align="{{{align|center}}}"
 
 
 
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.
 
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 Control ===
{{txtbox|override|margin-top=0px|margin-bottom=0|box=
+
{{tbl-init|width=auto|class=simple_table|caption=Wrap Options}}
'''pre'''      = White-space: pre;      - '''default''': acts like 'pre' whitespace preserved, text wraps at box border and line breaks.
+
!our code!!actual CSS!!Explanation
'''wrap'''    = White-space: pre-wrap;  - whitespace preserved, text wraps at box border and line breaks. Good for very long commands.
+
|-
'''wiki'''    = White-space: nowrap;    - is this the brain damaged method the magic (prefix w/space) wiki text boxes use??
+
|'''pre'''      || White-space: pre;      || '''default''': acts like 'pre' whitespace preserved, text wraps at box border and line breaks.
'''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.
+
|'''wrap'''    || White-space: pre-wrap;  || whitespace preserved, text wraps at box border and line breaks. Good for very long commands.
'''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}}
+
|'''wiki'''    || White-space: nowrap;    || is this 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; || use for simple 'pre' style formatting
 +
|}
  
{{note| there is some weirdness with unintended blank lines at the bottom. For some situations this can be fixed by using one long line that includes a <nowiki><br></nowiki> to assist formatting. The default is reasonable for most situations but would require the fix to avoid the extra unneeded space/lines.}}
+
{{caveat|icon64=There is was some weirdness with unintended blank lines at the bottom that was solved by switching to a table containing two spans. In some situations it may have been fixed by using one long line that includes a <nowiki><br/></nowiki> to assist formatting. The default is reasonable for most situations and should NOT require the fix to avoid the extra unneeded space/lines.}}
  
 
== Usage ==
 
== Usage ==
Line 25: Line 29:
 
'''<nowiki>{{</nowiki>txtbox|''width='''value'''''|box='''''content such as parens containing 5({{nbsp|5}}) spaces preserved,''<br>
 
'''<nowiki>{{</nowiki>txtbox|''width='''value'''''|box='''''content such as parens containing 5({{nbsp|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><nowiki>''</nowiki>''second line<nowiki>''</nowiki> - <nowiki>{{</nowiki>redlight|are possible too.<nowiki>}}</nowiki>'''''}}'''
+
'''|txt='''''Text to right of box''<nowiki><br/></nowiki><nowiki>''</nowiki>''second line<nowiki>''</nowiki> - <nowiki>{{</nowiki>redlight|are possible too.<nowiki>}}</nowiki>'''''}}'''
  
 
=== Result ===
 
=== Result ===
  
 
{{txtbox|box=content such as parens containing 5(    ) spaces preserved,
 
{{txtbox|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}}
''second line'' - {{redlight|are possible too.}}}}</noinclude><noinclude>[[category:templates]]<!-- There must not be any spaces after this comment. --></noinclude>
+
|txt=Text to right of box<br/>
 +
''second line'' - {{redlight|are possible too.}}}}</noinclude><noinclude>
 +
{{GroupListHeading|group=tables}}
 +
[[category:templates]]
 +
</noinclude>[[category:uses Txtbox]]

Latest revision as of 01:06, 22 November 2013

Contents

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

[edit] Wrap Control

Table Wrap Options [tables 1]
our code actual CSS Explanation
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; is this 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; use for simple 'pre' style formatting
Caveat:
There is was some weirdness with unintended blank lines at the bottom that was solved by switching to a table containing two spans. In some situations it may have been fixed by using one long line that includes a <br/> to assist formatting. The default is reasonable for most situations and should NOT require the fix to avoid the extra unneeded space/lines.

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

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

List of Tables


  1. Table Wrap Options