Template talk:Markup

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Merge[edit]

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 "<samp>". 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)[reply]

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 <samp> (it's not <tt>)? I just added that and am iffy on it myself. ---— Gadget850 (Ed) talk 19:22, 24 February 2012 (UTC)[reply]
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)[reply]
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)[reply]
And finally got around to adding more rows. ---— Gadget850 (Ed) talk 16:46, 25 February 2012 (UTC)[reply]
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)[reply]

Line breaks[edit]

The template shows a strange effect on Wikipedia:Line-break handling#Causing line breaks (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)[reply]

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)[reply]

Documentation: alternative[edit]

As an alternative to fake references and headings, one can use &lt; instead of < to avoid using fake references. One can also use &#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)[reply]

But the source text side has to be in <nowiki> 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)[reply]

Row height[edit]

One reason not to use this template right now is excessive row height. I put some examples for comparison at Template:Markup/testcases#Row-height examples. (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#Reduced padding.
  2. Line-height set in the vector skin:
    @media screen { .vector-body  {line-height} }
    @media screen { pre, .mw-code {line-height} }
    
    I'm not sure how to overwrite this.
  3. <p> margins and padding. I'm not sure how to overwrite this. Perhaps we can modify Template:Markup so there isn't a <p> 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)[reply]

 Fixed 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)[reply]
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 T352875. I have created T358921 to link to this discussion and two other related template discussions. – Jonesey95 (talk) 22:18, 1 March 2024 (UTC)[reply]