Template:Qud text/doc: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
mNo edit summary
(Category:Template documentation)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Usage ==
== Usage ==
 
<pre>
<syntaxhighlight lang = "xml">
{{Qud text|&amp;olalalalala&amp;OlALALALA&amp;YLALA!}}
{{Qud text|&amp;olalalalala&amp;OlALALALA&amp;YLALA!}}
</syntaxhighlight>
</pre>
{{Qud text|&amp;olalalalala&amp;OlALALALA&amp;YLALA!}}
{{Qud text|&amp;olalalalala&amp;OlALALALA&amp;YLALA!}}


The text does not remove trailing whitespace, so remove any extra space there is. Use this instead of calling ColorParse directly.
The text does not remove trailing whitespace, so remove any extra space there is. Use this instead of calling ColorParse directly.


If you're reading color codes not from an xml file (it doesn't have <code>amp;</code>), add "notxml" as a second argument.
If you're reading color codes not from an xml file (it doesn't have <code>amp;</code>), it will automatically try to detect it. To manually decide this, add <code>notxml</code> as an extra argument.


<syntaxhighlight lang = "c#">
<pre>
{{Qud text|&REat &rthe rich!| notxml }}
{{Qud text|&REat &rthe rich!}}
</syntaxhighlight>
</pre>
{{Qud text|&REat &rthe rich!| notxml }}
{{Qud text|&REat &rthe rich!}}


To prevent automatic bolding of text, add the "unbolded" argument.
To prevent automatic bolding of text, add the "unbolded" argument.


<syntaxhighlight lang = "c#">
<pre>
{{Qud text|&Cultra-light &belectronics| notxml | unbolded }}
{{Qud text|&Cultra-light &belectronics| unbolded }}
</syntaxhighlight>
</pre>
{{Qud text|&Cultra-light &belectronics| notxml | unbolded }}
{{Qud text|&Cultra-light &belectronics| unbolded }}
 
For dialogue from conversations.xml, you can also call <code>tildes are new lines</code> as another argument to automatically replace tildes with another linebreak.
<pre>
{{Qud text|Live and eat honey.~
Oh, look. It is a not-bear. Greetings, not-bear.~
Live and drink, little friend.~
I would enjoy some honey.~
*grunting*~
*snuffle*~
*whuffling*~
*heavy sigh*~|tildes are new lines}}
</pre>
{{Qud text|Live and eat honey.~
Oh, look. It is a not-bear. Greetings, not-bear.~
Live and drink, little friend.~
I would enjoy some honey.~
*grunting*~
*snuffle*~
*whuffling*~
*heavy sigh*~|tildes are new lines}}
 
All of these arguments can be used at the same time.


== Related Templates ==
== Related Templates ==


[[Template:Color|&#91;&#91;Color&#93;&#93;]]
[[Template:Color|&#91;&#91;Color&#93;&#93;]]
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 07:04, 4 April 2022

Usage

{{Qud text|&olalalalala&OlALALALA&YLALA!}}

lalalalalalALALALALALA!

The text does not remove trailing whitespace, so remove any extra space there is. Use this instead of calling ColorParse directly.

If you're reading color codes not from an xml file (it doesn't have amp;), it will automatically try to detect it. To manually decide this, add notxml as an extra argument.

{{Qud text|&REat &rthe rich!}}

Eat the rich!

To prevent automatic bolding of text, add the "unbolded" argument.

{{Qud text|&Cultra-light &belectronics| unbolded }}

ultra-light electronics

For dialogue from conversations.xml, you can also call tildes are new lines as another argument to automatically replace tildes with another linebreak.

{{Qud text|Live and eat honey.~
Oh, look. It is a not-bear. Greetings, not-bear.~
Live and drink, little friend.~
I would enjoy some honey.~
*grunting*~
*snuffle*~
*whuffling*~
*heavy sigh*~|tildes are new lines}}

Live and eat honey. Oh, look. It is a not-bear. Greetings, not-bear.

Live and drink, little friend.

I would enjoy some honey.

  • grunting*
  • snuffle*
  • whuffling*
  • heavy sigh*

All of these arguments can be used at the same time.

Related Templates

[[Color]]