User talk:TenOfAllTrades/Template:Markups

Purpose
PLEASE NOTE: This template may look like a lot of things that it is not. Kindly take the time to understand its purpose before editing it.

&#123;&#123;markups&#125;&#125; inserts a table of Unicode character entities in such a way that one can copy the codes without having to open the page for editing. There are thousands of Unicode entities; this particular small subset is geared to avoiding MediaWiki markup. This is useful when building technical templates, documenting templates and markup, or producing sample markup. In many cases,  tags can be used to suspend wiki rendering; but using the entities gives more flexibility and avoids known bugs.

Please do not add random entities to this template. Many common special characters may be typed into the edit box and will be resolved to entities if necessary. A JavaScript edit toolbar is available, though buggy. This template is already a little big and if much more goes in, something will have to come out.

Usage
Insert this template on your user page or a convenient subpage. Transclude or substitute as you please; substitution would normally be suggested for something of this kind, but it contains quite a lot of messy markup. Choose floatkey as either left or right; if no parameter is given, the table will float right anyway.

The next step is to copy entities into your markup, creating metamarkup. These will render as the markup characters themselves, rather than provoke actions. If the text of the rendered page is again copied and pasted into an edit window, then the markup will take effect.

If, on the other hand, you want to step backwards, creating metametamarkup, escape every &amp; with &#38;amp; or &#38;#38; -- thus constructs of the form &#38;amp;#nnnn; will render as &#38;#nnnn;

Note that these characters all have ISO-8859-1 named entities, such as &amp;rarr; (which renders as &#8594;); however, MediaWiki asserts Unicode encoding and it is safest to use Unicode entities here.

Note that it is highly unlikely that any of this material should appear in article mainspace. It is most useful when building technical templates or explaining some feature of markup to other editors.

Finally, if you don't understand this explanation, suggest you try this all out in the Sandbox or create one or more private sandboxes at &#091;&#091;User:Yourname/Sandbox1&#093;&#093;, etc. You'll be glad you did.

Examples of use
&#38;#60;div&#38;#62; &#8594; &#60;div&#62;

&#38;#091;&#38;#091;Billion&#38;#093;&#38;#093; &#8594; &#091;&#091;Billion&#093;&#093;

&#38;#123;&#38;#123;&#38;#091;&#38;#091;:billion]]}} &#8594; &#123;&#123;&#091;&#091;:billion]]}} &#8594;



History
Created and documented 03:34, 2005 May 31 (UTC) &mdash; Xiong &#29066; talk *

Improved self-documenting feature by removing echo of float parameter. No parameter still floats right; if no float then "width: auto;" defaults to full enclosing box width so the double float is kept. Replaced echo with standard helpbox (points here). &mdash; Xiong &#29066; talk * 14:37, 2005 August 11 (UTC)

Discussion
Sorry if I'm repeating myself, but edit this template with caution. I strongly encourage you to contact me on my talk page and ask for any improvements; I'll be happy to try to accomodate you. &mdash; Xiong &#29066; talk * 03:36, 2005 May 31 (UTC)

Entity names or Unicode numbers?
It seems to me that this would be better if it used named entities instead of resorting to the Unicode glyph number (not sure of the exact terminology there). Wouldn't names generally be easier to remember and thus encourage users to use them more regularly? Perhaps, at least, another column could be added with the names. &mdash; HorsePunchKid &rarr; &#x9F9C;  01:51, 27 September 2005 (UTC)


 * I seem to recall debating that point with myself, but unfortunately I can't recall exactly the reasoning that led up to my decision to implement with numbers rather than names. I think there were a few difficulties with names; some didn't work, some didn't exist or I couldn't locate them. Another point is that this really is code; it's not text at all. When scanning a block of markup by eye, numbered entities stand out as code, rather than blending in with the rest of the text. Since the entities usually appear inline with text, quite often without so much as a space on either side, it may be handy to have the code jump out.


 * That said, I'd have no objection if you wanted to do the template over with named entities. I'd ask that you not do it by editing this template to add yet another column, though. This is already a big, bulky box. You might go about it a few different ways:


 * Create a similar template with named entities.


 * Create a similar template with both named and numbered entities.


 * (Bonus points) Create a monstercool master template, with two or three daughters and a parameter that allows the user to switch among them. Be sure this is backward compatible, so current users of markups don't need to rewrite their parameter calls.


 * If you want to try for any of this, I strongly suggest editing in a private sandbox first. I'm hardly ever around Wikipedia anymore, so if you'd like to discuss this with me, please email me (click the Chinese character in my sig). &mdash; Xiong &#29066; talk * 14:46, 17 November 2005 (UTC)