Template talk:Markup

Merge
I created a similar template, Wikitext example The two should probably be merged. Comparing the two:
 * Wikitext example leaves the normal border around the table. This is just cosmetic, and I don't care either way.
 * Wikitext example has direct support for multiple rows (by repeating the code), but of course markup has a usable work-around for this.
 * Wikitext example renders the right column in the default font, rather than " " . I actually prefer this quite a bit; you want the user to see what they are going to get accurately.
 * Finally, I think the title "Wikitext example" is more informative.
 * A few other technical differences with the width and so on, which I don't care about.

What do you think? The only points I feel strongly about are the title and the font on the right.

The merge is easy, of course, because they take exactly the same parameters, and I never got around to using "Wikitext example" in the documentation pages. I tried it out in Harvard citation documentation and WP:Verification methods as well, just to see if it looked good on those pages. CharlesGillingham (talk) 18:48, 24 February 2012 (UTC)


 * I wasn't aware of this template until recently, which is why I created markup. I chose the name because it can be used for purposes other than template documentation.
 * Which output style do you prefer: plain or formatted with (it's not )? I just added that and am iffy on it myself. ---—  Gadget850 (Ed)  talk 19:22, 24 February 2012 (UTC)


 * I guess the name isn't really that big an issue. It's just "documentation assistance" template, after all; no one will use it except for a few of us.


 * I think the right side should appear in Wikipedia's normal font, so that it looks just like the rest of Wikipedia. CharlesGillingham (talk) 21:06, 24 February 2012 (UTC)
 * I reverted the font. Seemed like a good idea at the time, but I wasn't stuck on it. ---— Gadget850 (Ed)  talk 22:02, 24 February 2012 (UTC)
 * And finally got around to adding more rows. ---— Gadget850 (Ed)  talk 16:46, 25 February 2012 (UTC)


 * Looks great. I removed any uses of my version and I'm going to have it deleted. They are merged. CharlesGillingham (talk) 02:34, 26 February 2012 (UTC)

Line breaks
The template shows a strange effect on Line-break handling (relevant version of the page). The "renders as" part does have a line break after "A single newline in the markup does not cause a visible line break.", but it obviously shouldn't have. For now I'll remove the markup template and use a wikitable instead. Huon (talk) 22:26, 28 December 2012 (UTC)
 * For the record (should anyone happen across this note), the rendering issue with markup and single newlines has apparently been fixed in the intervening half-decade, as the linked page version now renders correctly. I removed the extra hoops that were being jumped through in the Wikipedia:Line-break handling source to work around the former bug. -- FeRD_NYC (talk) 09:16, 5 July 2018 (UTC)

Documentation: alternative
As an alternative to fake references and headings, one can use &amp;lt; instead of < to avoid using fake references. One can also use &amp;#61; instead of the first = (to avoid wrong level headings) to make the heading's markup be rendered as plain code instead of a heading. See here. Alfa-ketosav (talk) 13:51, 1 July 2021 (UTC)


 * But the source text side has to be in  tags in any case -- so I think you're solving the wrong problem. "Fake heading" is used to keep any headings inside the box out of the table of contents. CharlesGillingham (talk) 04:15, 22 September 2021 (UTC)

Row height
One reason not to use this template right now is excessive row height. I put some examples for comparison at Template:Markup/testcases. (I'm not sure where is the most appropriate place to put this kind of large example for discussion.) I have tested and the issue appears with multiple skins, eg. Vector 2022, Monobook, and Timeless.

On (old) Vector skin, the rows are currently 48.4 pixels tall, when my alternative to Template:Markup, a simple Wikitable, has rows that are only 24.1 pixels tall. Thus Template:Markup is twice as tall as my alternative, with an excess of 24.3 pixels per row. With Vector-2022, it's similar, with an excess of 19 pixels.

With Vector-2022, here are the row heights (obtained via Firefox Developer Tools):
 * 48px Default
 * 38px using existing template parameters (with line-height, with paragraph padding and margins)
 * 33px without line-height, with paragraph padding and margins
 * 24px with line-height, without paragraph padding and margins
 * 19px without line height, without paragraph padding and margins
 * 29px Comparison Wikitable

Contributing factors and possible solutions:
 * 1) Padding in Template:Markup/row, which I can overwrite with col1style and col2style eg, Template:Markup/testcases.
 * 2) Line-height set in the vector skin:undefined I'm not sure how to overwrite this.
 * 3)  margins and padding. I'm not sure how to overwrite this. Perhaps we can modify Template:Markup so there isn't a  at all?

Of course, we probably don't actually want to eliminate all padding.

How could we modify Template:Markup to make it possible to have reduced row height? Can we make Template:Markup as compact as a simple Wikitable? Daask (talk) 17:32, 1 March 2024 (UTC)


 * I removed the paragraph element from the right column, which reduced the default row height to a more reasonable size. Also, with the already-existing parameters, col1style and col2style, all remaining padding can be eliminated (not that I recommend that). Please respond if you have concerns about this new reduced default row height or the lack of a paragraph element in the second column. Daask (talk) 20:01, 1 March 2024 (UTC)
 * I think this change broke cases in which the second parameter contains a template that generates a table, since table markup needs to start on a new line. I think the spacing problems, if they are new, are related to . I have created to link to this discussion and two other related template discussions. – Jonesey95 (talk) 22:18, 1 March 2024 (UTC)

Line breaks and syntaxhighlight
mw:Extension:SyntaxHighlight usually preserves line breaks in its contents, but it doesn't when the inline parameter is set. This template has used the inline parameter since SyntaxHighlight was first introduced by in February 2024. (Thanks!) I'm inclined to add a non-inline option in order to preserve line breaks, but I can't decide on the interface. Options:
 * 1) Add special values for the tag, namely syntaxhighlight-inline and syntaxhighlight-block, with one of these being the default for syntaxhighlight.
 * 2) Add a new parameter yes/no. no with (empty) is the same as span. no with pre is an error. yes with any value except pre or syntaxhighlight is an error
 * 3) Remove parameter tag entirely and replace it with yes/no and yes/no to obscure implementation details from users.
 * 4)  Unfortunately, mw:Extension:SyntaxHighlight appears to ignore all values supplied to it's inline parameter., , , , and inline with no value all activate the inline feature.

I'm inclined to go with option 3. The tag parameter is only a few months old, so breaking the existing interface doesn't seem as dramatic as it would with a long-existing parameter. Thoughts? Daask (talk) 19:57, 29 April 2024 (UTC)