Template:Monzo: Difference between revisions

m Wikipedia has an article on code point and we can link directly
Simply call Template: Ket to do the rendering
Line 1: Line 1:
<includeonly><span class="monzo"><span class="left-delim">&#91;</span>{{trim| {{{1|{{{text|0}}}}}} }}<span class="right-delim">&#x27E9;</span></span></includeonly><noinclude>
<includeonly>{{#if: {{{legend|}}} | [[monzo]]:&nbsp;}}{{ket| {{{1|0}}} }}</includeonly><noinclude>
This template eases using [[monzo notation]]: it puts the right brackets (<code>&#91;</code> and <code>&#x27E9;</code>) around its arguments (it also removes surrounding space).
This '''monzo''' template eases typing [[monzo]]s: it puts ket notation (<code>&#91;</code> and <code>&#x27E9;</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>{{monzo| -19 12 }}</nowiki></code> or the equivalent
: <code><nowiki>{{monzo| -19 12 }}</nowiki></code>
: <code><nowiki>{{monzo|text= -19 12 }}</nowiki></code>
: <code><nowiki>{{monzo|legend=1| -19 12 }}</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="monzo"><span class="left-delim">&#91;</span>{{trim| -19 12 }}<span class="right-delim">&#x27E9;</span></span>
: {{{{PAGENAME}}| -19 12 }}
: {{{{PAGENAME}}|legend=1| -19 12 }}


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


== See also ==
== See also ==
* [[Template:Val]]
* [[Template: Val]]
* [[Template:Lbrack]]
* [[Template: Ket]]
* [[Template:Trim]]
* [[MediaWiki:Common.css]] ... contains style definition(s) for the <code>monzo class</code>


[[Category:Templates]]
[[Category:Templates]]