Template:Val: Difference between revisions

m Wikipedia has an article on code point and we can link directly
Simply call Template: Bra to do the rendering
Line 1: Line 1:
<includeonly><span class="val"><span class="left-delim">&#x27E8;</span>{{trim| {{{1|{{{text|0}}}}}} }}<span class="right-delim">&#93;</span></span></includeonly><noinclude>
<includeonly>{{#if: {{{legend|}}} | [[val]]:&nbsp;}}{{bra| {{{1|0}}} }}</includeonly><noinclude>
This template eases using [[val notation]]: it puts the right brackets (<code>&#x27E8;</code> and <code>&#93;</code>) around its arguments (it also removes surrounding space).
This template eases typing [[val]]s: it puts bra notation (<code>&#x27E8;</code> and <code>&#93;</code>) around its arguments (it also removes surrounding spaces), and you may optionally include a legend.  


== Usage example ==
== Usage example ==
; You type
; You type
: <code><nowiki>{{val| 31 49 72 87 }}</nowiki></code> or the equivalent
: <code><nowiki>{{val| 31 49 72 87 }}</nowiki></code>
: <code><nowiki>{{val|text= 31 49 72 87 }}</nowiki></code>  
: <code><nowiki>{{val|legend=1| 31 49 72 87 }}</nowiki></code>
(the option of adding spaces supports readability of the wiki markup)
 
:'''Tip''': adding spaces improves readability of the wiki markup.


; You get (rendered)
; You get (rendered)
: <span class="val"><span class="left-delim">&#x27E8;</span>{{trim| 31 49 72 87 }}<span class="right-delim">&#93;</span></span>
: {{{{PAGENAME}}| 31 49 72 87 }}
: {{{{PAGENAME}}|legend=1| 31 49 72 87 }}


== Technical Note ==
== Technical note ==
[[Wikipedia: Code point|Code point]] [https://www.compart.com/unicode/U+27E8 U+27E8] is used for the left angle bracket <code>⟨</code>, the ASCII approximation is less-than symbol (<code>&lt;</code> or <code>&amp;lt;</code>).
This template calls [[Template: Bra]] to render the brackets.  


== See also ==
== See also ==
* [[Template:Multival]]
* [[Template: Multival]]
* [[Template:Monzo]]
* [[Template: Monzo]]
* [[Template:Rbrack]]
* [[Template: Bra]]
* [[Template:Trim]]
* [[MediaWiki:Common.css]] … contains style definition(s) for the <code>val class</code>


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>