Template talk:Mono
Text has been copied to or from this page; see the list below. The source pages now serve to provide attribution for the content in the destination pages and must not be deleted as long as the copies exist. For attribution and to access older versions of the copied text, please see the history links below.
|
Use for code
[edit]The documentation for this template currently says it should not be used for inline source code, but I and others have been using it for this purpose because <code> is so ugly. What should I do to get this changed? QVVERTYVS (hm?) 10:45, 15 March 2015 (UTC)
- Discuss at WP:VPT. -- Gadget850 talk 14:48, 8 May 2015 (UTC)
Template-protected edit request on 3 November 2017
[edit]This edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Why is "monospace" listed twice? List it once. Anomalocaris (talk) 20:40, 3 November 2017 (UTC)
- Not done Looking at the edit summaries in the history of the template, it seems that this is needed to make the template work properly in the Chrome browser. -- John of Reading (talk) 20:56, 3 November 2017 (UTC)
- John of Reading Ah, so! Thanks for your reply. —Anomalocaris (talk) 22:13, 5 November 2017 (UTC)
- I can confirm that as of this timestamp this (harmless) CSS hack is still required. — SMcCandlish ☏ ¢ 😼 05:32, 28 July 2018 (UTC)
- John of Reading Ah, so! Thanks for your reply. —Anomalocaris (talk) 22:13, 5 November 2017 (UTC)
Bad substitution
[edit]Izno, a search for the emitted templatestyles shows that this template has been substituted ca. 35 times since it was converted to use templatestyles. do we need to add some {{ifsubst}} or unsubst logic to avoid unclean substitution? Frietjes (talk) 16:54, 23 October 2018 (UTC)
- @Frietjes: I'd say so -- if substed, should not output the templatestyles tag. The user in question should be told not to use the template directly as a followup if he wants to retain monospaced text. --Izno (talk) 17:01, 23 October 2018 (UTC)
- @Usernamekiran: Frietjes (talk) 17:03, 23 October 2018 (UTC)
- @Frietjes and Izno: Thanks. I am not exactly sure what we are discussing here. If I'm guessing correctly, then we are talking about substituting mono template. In that case, I've stopped doing it a while ago. Kindly see User talk:Usernamekiran/Archive 6#Are you substing Template:Mono in your signature? For current situation. If I need to make changes in my signature, kindly let me know; and I will do it accordingly —usernamekiran(talk) 19:13, 23 October 2018 (UTC)
- Usernamekiran, great, no action needed at this point in time. Frietjes (talk) 19:39, 23 October 2018 (UTC)
- @Izno and Frietjes: currently sporkbot is unsubstituting templatestyles. special:diff/865576272. He even went through my archives. —usernamekiran(talk) 23:19, 24 October 2018 (UTC)
- Usernamekiran, yes, I made the request per WP:TemplateStyles (
Substituting a template which uses TemplateStyles leaves the
), so the issue here is resolved, assuming no one else tries to substitute it. for {{smallcaps}} there is now {{ifsubst}} to prevent unclean substitution. we could do that here as well. Frietjes (talk) 23:22, 24 October 2018 (UTC)<templatestyles />
tag in the resulting code, which may be confusing and negates many of the benefits of using TemplateStyles in the first place.
- Usernamekiran, yes, I made the request per WP:TemplateStyles (
- @Izno and Frietjes: currently sporkbot is unsubstituting templatestyles. special:diff/865576272. He even went through my archives. —usernamekiran(talk) 23:19, 24 October 2018 (UTC)
- Usernamekiran, great, no action needed at this point in time. Frietjes (talk) 19:39, 23 October 2018 (UTC)
- @Frietjes and Izno: Thanks. I am not exactly sure what we are discussing here. If I'm guessing correctly, then we are talking about substituting mono template. In that case, I've stopped doing it a while ago. Kindly see User talk:Usernamekiran/Archive 6#Are you substing Template:Mono in your signature? For current situation. If I need to make changes in my signature, kindly let me know; and I will do it accordingly —usernamekiran(talk) 19:13, 23 October 2018 (UTC)
- @Usernamekiran: Frietjes (talk) 17:03, 23 October 2018 (UTC)
Wikilinks and external links
[edit]This template does not work around or inside wikilinks and external links.
[[Fox|{{mono|The quick brown fox}}]]
: The quick brown fox{{mono|[[Fox|The quick brown fox]]}}
: The quick brown fox[https://www.harvard.edu/ {{mono|Harvard}}]
: Harvard{{mono|[https://www.harvard.edu/ Harvard]}}
: Harvard
—Anomalocaris (talk) 19:41, 16 May 2021 (UTC)
I had forgotten that I had posted the above, and I just edited and removed a bunch of edits to this talk page based on the belief that the template has problems around <nowiki>...</nowiki>
tags. I now believe the problem related to wikilinks. The problem with wikilinks and external links remains and should be fixed. —Anomalocaris (talk) 04:25, 13 July 2022 (UTC)
- [I took the liberty of numbering the examples above for clear reference.] Testing so far:
- Chrome: All examples display in monospaced font as Anomalocaris expected.
- Opera: All examples render in sans-serif (or whatever your browser, your user CSS, or your "skin" have set WP's default text to).
- Opera GX: Same as Opera.
- Firefox: Same as Opera.
- Edge: Same as Opera.
- Brave: Same as Opera.
- That's all in Windows 11. This seems doubly strange to me. What should be expected across all of these browsers (and any others) is for examples 1 and 3 to render in monospace, because the template is inside the linked text, so the default link-styling CSS should be overridden by the more specific, interior class of the mono template; but examples 2 and 4 should rendered sans (or whatever your settings dictate), because the template comes first then is overriden by more specific link conditions. Without closely scrutinzing the rendered HTML source in each browser, I'm not entirely sure why this is happening or what to do about it. None of the browsers are doing what is expected, yet Chrome is doing something very different from the rest (despite several of them also being based on the Chromium engine on which Chrome is obviously built). I have too many projects going on already; maybe someone else can look into this in more detail.
Addition text cases, with partial-monospacing of the link text:
- 1a.
[[Fox|The {{mono|quick brown}} fox]]
: The quick brown fox - 3a.
[https://www.harvard.edu/ {{mono|Harvard}} University]
: Harvard University - And inline markup:
- 1b.
[[Fox|<span style="font-family: monospace;">The quick brown fox</span>]]
: The quick brown fox - 3b.
[https://www.harvard.edu/ <span style="font-family: monospace;">Harvard</span>]
: Harvard - 1c.
[[Fox|The <span style="font-family: monospace;">quick brown</span> fox]]
: The quick brown fox - 3c.
[https://www.harvard.edu/ <span style="font-family: monospace;">Harvard</span> University]
: Harvard University - Those all (1a through 3c) display as expected in Chrome; not tested yet any further. — SMcCandlish ☏ ¢ 😼 12:04, 2 May 2024 (UTC)
Repetition in TS style
[edit]Just curious. Currently, Template:Mono/styles.css has
font-family: monospace, monospace;
Is there a reason for this repetition? -DePiep (talk) 18:15, 19 November 2021 (UTC)
- @DePiep: Yes, see the information in WP:MONO linked in the comment above. Basically some browser threat
font: family: monospace;
specially and reduces the font size.monospace, monospace
works around this. I'm not sure if this still is a problem in newer browsers. See also T176636. -- Tholme (talk) 15:15, 15 March 2022 (UTC) T176636
Obsolete CSS trick?
[edit]The font-family: monospace, monospace;
trick, to stop certain browsers from messing with the relative font size of monospaced text, reportedly no longer works across all browsers, while font-family: monospace, serif;
or font-family: monospace, sans-serif;
will work (and no browser will change the display to [sans-]serif, because "monospace" is matched first). NB: I got this from forums (StackExchange, I think, and some others, not from CSS books from Wiley or the like. — SMcCandlish ☏ ¢ 😼 11:31, 2 May 2024 (UTC)