Re: How 'bout a <pre> (and other stuff) warning?
by wazoox (Prior) on Oct 19, 2006 at 10:48 UTC
|
| [reply] |
Re: How 'bout a <pre> (and other stuff) warning?
by planetscape (Chancellor) on Oct 20, 2006 at 02:09 UTC
|
Another excellent case for the judicious use of pre tags is Saturn.
Personally, I've found adding the following to my On-Site CSS Markup is quite helpful in determing at a glance whether pre tags are the problem:
/* Adjust pre/code font, size */
pre { color: MediumAquaMarine }
pre.code.c { font-size: 12pt; font-family: consolas; color: LightSteel
+Blue }
tt.codetext { font-size: 12pt; font-family: consolas; color: LightStee
+lBlue }
tt.inlinecode { font-size: 12pt; font-family: consolas; color: LightSt
+eelBlue }
Doubtless other Monks will want to adapt this to their own needs and preferences (for one thing, I need a large font because I am visually impaired).
HTH,
| [reply] [d/l] [select] |
Re: How 'bout a <pre> (and other stuff) warning?
by grep (Monsignor) on Oct 19, 2006 at 21:10 UTC
|
I completely agree. I would expand it just a little more and add some simple sanity checks that generally get instantly considered. It might help reduce some of the janitorial work.
My addition would be inform the user of proper titles if the title =~ /^\S+::\S+$/ or title =~ /^\S$/.
Maybe even title =~ /^help\s+me/i or /^urgent\s+help/i
grep
|
One dead unjugged rabbit fish later |
| [reply] |
Re: How 'bout a <pre> (and other stuff) warning?
by GrandFather (Saint) on Oct 19, 2006 at 21:50 UTC
|
I completely agree, except you are preaching to the choir. The preview already includes the text:
If something looked unlike you expected it to you might need to check out Writeup Formatting Tips
and:
- Are you posting in the right place? Check out Where should I post X? to know for sure.
- Posts may use any of the Perl Monks Approved HTML tags: a, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul.
- Snippets of code or other preformatted text should be wrapped in <code> tags, not <pre> tags. In fact, <pre> tags should almost never be used.
- Outside of code tags, you may need to use entities for some characters: "&" is "&", "<" is "<", ">" is ">", "[" is "[", "]" is "]"
- See Writeup Formatting Tips and other pages linked from there for more info.
which seems to be completely ignored by many who post, especially those who are fairly new to PerlMonks. Why should some additional text make any difference?
DWIM is Perl's answer to Gödel
| [reply] |
|
|
| [reply] [d/l] |
|
|
Ooh, how about blinking text? ;)
Seriously, the bold red works best when used sparingly. For example the words "bold red" in your post stand out and grab my attention, but the sentences you wrote just sort of disappear on my screen.
How about something like:
Warning:
Your node may have some problems -
- Please limit the use of <pre> tags. When possible, use <code> tags instead.
- Please use a descriptive title (avoid 1 word titles or module names as the entire title)
| [reply] [d/l] [select] |
|
|
|
|
I completely agree, except you are preaching to the choir. The preview already includes the text:
[snip]
That's what I meant with "which is not really an excuse for not reading that they're discouraged anyway" in my reply to this comment of yours.
OTOH with "visually distinctive" I meant something that should really catch the eye, e.g. like someone else said, bold red, at least in default themes - if someone changes that, he will be on his own. But then again chances are he/she will already know what he/she is doing. And of course all this wouldn't be in substitution of the current warnings and reminders, but in complement to them: of course one may not want to see such visually "invasive" warnings under normal circumstances.
| [reply] [d/l] |
Re: How 'bout a <pre> (and other stuff) warning? (fix)
by tye (Sage) on Oct 23, 2006 at 04:17 UTC
|
I'd rather just solve the problem by having PerlMonks render PRE blocks rather similarly (but not identically) to how it renders CODE blocks. I'd also be in favor of a toggle that turns off the wrapping tricks for those rare cases when you actually want a node rendered wider than you choose to (or perhaps can) make your browser window because you want to scroll to the left or right side and look at that part of the node without other wrapped stuff getting in the way.
I see that my quite-up-to-date version of FireFox still doesn't properly support soft hyphens so the best way to deal with this stuff is still mostly only handled by IE1 (which follows the standard on this point, unlike FireFox, and has for many years now, in case you didn't get the irony).
BTW, if you don't like my idea, one reason certainly could be that you don't use IE and so don't have access to (a working version of) the lovely "auto code wrap" feature. It is probably a bit of work to borrow a copy of IE (or other soft-hyphening browser) and set up "auto code wrap" and play with it enough to see how lovely it works, but you might consider doing that... (:
1 Yes, I've heard that Opera also now supports soft hyphen (and I suspect that there are other browsers that support it by now)
| [reply] |
|
|
I'd rather just solve the problem by having PerlMonks render PRE blocks rather similarly (but not identically) to how it renders CODE blocks.
This is an equally good and seemingly viable solution. For more stuff in this vein, I've occasionally felt the need for <code> blocks that still allow (some) formatting tags and/or entities, like in the [id://578807#conclusion|case] I was referring to above, perhaps in the form of suitable attributes, like:
<code allowentities="yes" allowtags="yes" wrapoff="yes">
I'd also be in favor of a toggle that turns off the wrapping tricks[...]
I second this too, perhaps in the form of another attribute as in the example above (of course they should all default to "no"). The point being that the problem with <pre> tags is that (some) people already knows about them, and it's just so easy to insert them, whereas such attributes would be totally uncommon and annoying enough to insert that one would really do so only in those rare cases he would really need them.
BTW, if you don't like my idea, one reason certainly could be that you don't use IE and so don't have access to (a working version of) the lovely "auto code wrap" feature. It is probably a bit of work to borrow a copy of IE (or other soft-hyphening browser) and set up "auto code wrap" and play with it enough to see how lovely it works, but you might consider doing that... (:
Actually I have Exploder installed but use exclusively FF. You made me curious about this "lovely feature" and I think I will try, but I won't change my browser anyway. Only I will hope the FF guys will implement something similar soon too! | [reply] [d/l] [select] |
|
|
| [reply] [d/l] |