Improve the CMD bbcode?

I love having organized and clean posts as much as anyone else on these forums (or so I think!), but the CMD tag does not quite cover the scenarios where I provide commands and/or arguments.

It makes a new full line per command, so I cannot write a coherent sentence which mentions multiple commands to try.
Example
You might want to try # service sshd restart. If that fails, you might want to ensure your firewall rules (/etc/rc.firewall.rules) are correct, then either verify it's loaded by # ipfw list or just reload the filter rules with # service ipfw restart


It also strips any extra white space, which means I end up doing something like this:
# zpool list
Code:
NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
storage  8.12T  2.28T  5.85T    28%  1.00x  ONLINE  -

And that does not really look right, so I usually end up just dropping the CMD tag all together, and just placing the command inside the code block instead:
Code:
# zpool list
NAME      SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
storage  8.12T  2.28T  5.85T    28%  1.00x  ONLINE  -

I am not sure if the CMD bbcode is currently doing what it's intended to, nor how to improve the CMD bbcode to better handle the aforementioned scenarios. But I figured I should mention it, in case somebody else do. :)
 
For inline commands, I use [file] tags.

When there is a a command followed by output, [code] is the right way to do that, keeping everything in one box. The system is smart enough to handle cmd inside code tags:
Code:
[cmd="#"]ls -lh /etc[/cmd]
lrwxr-xr-x  1 root  wheel       12B Jan  3  2012 aliases -> mail/aliases
-rw-r--r--  1 root  wheel      212B Apr 28  2012 amd.map
-rw-r--r--  1 root  wheel      1.2k Apr 28  2012 apmd.conf
...

When the cmd tag is clicked, it asks for an "option". I'd like to see that ask for a prompt, or at least give an error if the user puts in more than one character.

I'd also like to see code tags stop putting that annoying blank line in at the end.
 
wblock@ said:
The system is smart enough to handle cmd inside code tags
Good that you point this out. I get the impression that it is easily forgotten or overlooked.

Having said that, I can understand the desire for an "inline version" of [cmd]. Particularly when commands are short I think they may look better when integrated into the prose. Due to the background color they'd probably still stand out sufficiently.
 
BBCode output looks nice, but you could implement some features to improve CSS techniques. CSS can do many things that other BBCode also cover. Some of the other BBCode is simpler to use, but the strength of the CSS BBCode is its flexibility. Some of the more commonly properties used ones are covered in this w3schools CSS Reference, but the CSS BBCode can only handle the style properties. Additionally, not all CSS properties are compatible with every browser, particularly the properties introduced in the newest version of CSS/CSS3. Also see CSS comparison of layout engines.

Have a look at CSS vendor prefixes:

CSS -moz-: https://developer.mozilla.org/en/CSS_Reference/Mozilla_Extensions.
CSS -webkit-: http://qooxdoo.org/docs/general/webkit_css_styles.
CSS -o-: http://www.opera.com/docs/specs/presto27/css/o-vendor/.
CSS -khtml-: http://www.konqueror.org/css/.
CSS -ms-: http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspx.

To note that Microsoft's CSS implementation is crap ;)
 
Carpetsmoker said:
And while the fashion of the week has been implemented, it's still broken and nonfunctional.

http://forums.freebsd.org/showthread.php?t=23507
For what it's worth: [code] segments currently add scrollbars to the entire page rather than just the [code] segment, which means that if a post contains wide code one has to scroll back and forth not just for the code segment, but for the entire post and even thread. Since I nowadays mostly visit these forums using a netbook, I've discovered how annoying this really is. I would definitively prefer that code segments have their own scrollbars rather than forcing me to scroll back and forth for the entire duration of the thread (or at least whatever portion fits on a single page).
 
That would be horizontal scrollbars. Yes, those are annoying. If there is a way to fix those, please suggest it.

Vertical scrollbars now look great and do not overlay the text.
 
The only way I can do this (and it's not as if we haven't been trying, people ..) is to hard-limit the [code] width to, say, 800 pixels. This is not dynamic, so when your browser window is more narrow than that, the window's scroll bars will still show up. If you have a very wide hi-res screen, these boxes will look eerily narrow. If anyone knows of how to dynamically limit the [code] width to a percentage of the screen width, introducing scroll bars when the contained text exceeds that width, by all means say so. All I have now is 'auto' (which doesn't do much that I can see), or a px value. Complaining is facile, suggest a solution.

As far as the [cmd] tag is concerned, I consider that done. It works. I never really liked how it worked before, this is better, and the [file]+[b] workaround is no longer necessary (and taken out of the formatting guidelines).
 
DutchDaemon said:
The only way I can do this (and it's not as if we haven't been trying, people ..) is to hard-limit the [code] width to, say, 800 pixels. This is not dynamic, so when your browser window is more narrow than that, the window's scroll bars will still show up.
I had already been pondering a solution but couldn't think of one, although just because I can't think of a solution obviously doesn't mean there isn't one ;) If it's not possible to limit [code] segments to a certain percentage of the "normal" width I suppose this is something that, annoying as it may be in some cases, we may just have to live with. After all, as far as I know there's no reliable way of determining what a user's "normal" screen width is and therefore no reliable way to adjust [code] segments accordingly. If someone (@drhowarddrfine perhaps?) can think of a way that would be truly awesome, but to be honest I doubt it can be done.

On a side note: is the editing window set to a fixed width as well? On my netbook it's slightly wider than the browser window so there's a bit of jumping back and forth involved. Nothing I can't live with, so please don't consider this a complaint, but I just figured I'd mention it anyway.

DutchDaemon said:
As far as the [cmd] tag is concerned, I consider that done. It works.
It # does seem so, yes. ;)
 
Last edited by a moderator:
The 'quick reply' and 'edit' boxes resize with the browser width, the 'Go Advanced' editor box does have a fixed width, or else it will default to a very small box (also fixed width). Or do you mean something else?
 
Complaining is facile, suggest a solution.

My post didn't receive a reply. I am pretty much always willing to do legwork for suggestion I make, but I wasn't sure if the administration perceived this as a problem and actually wanted it fixed.
If someone from the administration would have said `Sorry, we can't get this to work', or even just `I agree, can you suggest a solution?' I would have done so.

In any case, I see the width has been set to 800px now, which is certainly an improvement IMHO. I'll try for a better solution.
 
Back
Top