Adding phpBB inline code [c][/c] would still be handy

xoa

Ars Legatus Legionis
12,752
Subscriptor
Been about 3 years since I think this came up last, but I just thought of it again from over in the Achaia trying to give a few commands to someone totally unfamiliar with the CLI and having the oh so familiar newbie issue of "that command without the quotes though" come up again :). I don't know if any of you still futz around with the underlying forum much, but adding in one of the custom inline code things ala this community one or similar. My vague recollection is a limitation of some of those vs the full code blocks was they didn't do color formatting but I don't think Ars does that anyway. At any rate, would be handy from time to time.
 

xoa

Ars Legatus Legionis
12,752
Subscriptor
Are you asking for something

[typewriter]that looks like this?[/typewriter]

What exactly is needed? More than just monospaced or is that it?
Ideally, like the , it'd also have a box and alt bgcolor for improved readability and differentiation even if it was code. I found this phpBB community thread from back in 2010 that has a bunch of examples of roughly what I had in mind. Just mimicking the full
Code:
 style with on Ars too does have a pixel border around the box and white background regardless of post background, though for inline no box expansion controls would be good. Would be enough to just set CSS border to 1px and background to alt color I think. That thread is from a long time ago so I don't know if the engine has improved at all since, but brief bit of search seems to indicate there were limitations with parsing depth that make some features hard. But since we don't have autocolor or anything like that regardless I don't think any of that should be an issue here. I just envision something monospace and with a box/background but no line break or extraneous sizing, so it's very clear it's a distinct command or code snippet and not part of the rest of the post. The [typewriter] gives the monospace which is important, but it's a little too visually subtle depending on display device. If possible it'd also be useful to have it disable any further bbcode interpretation within it like [code] itself does, so that bbcode can be displayed in snippets too. It's been a really long time since I've poked around in phpBB though so I honestly have no idea how much work preserving behavior would be.

Not a big feature, but it'd add some clarity for some troubleshooting efforts. I mean, even in this post if I close one of the open code tags for another example block the whole thing turns to code, the tags don't stick out. Thanks for giving it a thought!
 

xoa

Ars Legatus Legionis
12,752
Subscriptor
I don't really understand then. What is it that

Code:
putting things in code tags

isn't doing if you want the box still?
I don't understand what you don't understand? How does this (taking armwt's post with extra quotes which made me think of it as an example):
W5P_qoiYOG020t5QQ127-zN7SLC7MppwtxXJotN2I0zHGF5K_BPDe-_RzSipVqPpiNy2wInjtLV8PWCZsLFfOvD7iAUOl9NfH-oWxLL7EzEufMjDq2PqiMiEvbTgAYisAzuuVHfk=w2400

look like this?
N4OUXfIyJ2U3XO7gc654wbNS3EcoQh0axMxqlC2mZVk1Q1jaFCDsBmUnMidtYiDAJrYh1uBSiCqpzi6I946oY7FDvJCcFw7lm1gtJ5Ssem7hhMYmEHiD-agMpWR9ZK4iHyvBc-g4=w2400
 

xoa

Ars Legatus Legionis
12,752
Subscriptor
Ohhhhhhhhhhh. That wasn't obvious at all from your initial post. (probably due to the lack of an example)
Very sorry about that! I had mental model going thinking "box" in terms of CSS border: 1px solid #C0C0C0; and they had some examples where I linked, but I can see how I didn't make that clear. A visual example would have been better, though actually when I went to post those pictures I realized it's become a bit more irritating to find places for that. Photobucket is now paid, ImageShack of course long gone, imgur is weird and I suspect will have the same issue some day. I managed to get an embeddable link out of Google Photos but it mangled the PNGs. I miss the old subscriber benefit of a few dozen megs of native hosting :p. I'm sure there are a bunch of old posts in the OpenForum too (including a bunch of mine) with image links now dead.
Ah, I didn't understand what you were asking for, that's clear now.

Okay, I have added c bracket to give you results like this in the forum.
Super sweet, and already handy! Thanks for doing this. One minor stylistic point is that in my example I found it worked better to match the lighter gray of the code box rather then just black, I think it's #C0C0C0 or something like that, a little less stark. But either way appreciate it.
 
Aurich and other Ars staffers,

Thanks for listening. I'm not invested in this particular request, but it's always great to feel like we (as an audience) are being listened to. I completely understand that you can't fulfill every request that's made (and there are a bunch that don't make sense, *cough* certain other requests in this subforum *cough*), but your responsiveness and helpfulness are greatly appreciated. You folks get enough grief that I figure a random thank-you might be a nice change. :D
 

spiralscratch

Ars Praefectus
3,103
Subscriptor
Nice, I like this addition.

I don't mean to be critical, but a few aesthetic issues that I noticed:
  • The border and padding can encroach on the lines above and below.
  • It also looks kinda weird to have the border broken up when the tag makes a box that wraps to a new line and leaves openings at either end.
  • The white background doesn't stand out against with the background of posts that are also in white (as opposed to the gray the other half use).

FWIW I played around with the attributes for a few minutes and came up with the following, which I think works pretty well:
Code:
background-color: #e0ffe0;
padding: 1px;
font-family: monospace;

Before:
IKstjOY.png


After:
4qBua5s.png


Also, you may want to change the pop-up description for the reply editor's button for the tag from "code text here" to something like "inline code" to better differentiate it from the 'code' tag.

Thoughts from others?
 

xoa

Ars Legatus Legionis
12,752
Subscriptor
<background-bg>Thoughts from others?
Awesome! Except...

Terminator: I'll be back.
Narrator: He was right.
Sovereign: I am the vanguard of your destruction.

Hmm, the overlap on successive lines doesn't look too great.
Yeah, I see the issue with the current padding, but I don't think background color does as good a job either. In my original testing I used 1px padding, which doesn't have any overlap. But I can see Aurich's point about squashed-ness a bit, but I think the answer actually might be to just have separate horizontal and vertical padding. So padding: 1px 3px; rather then just 3px. For horizontal languages it seems to feel less cramped to have more right/left then up/down, and preserves line height with no further messing around. Even beyond overlap, I think 3px vertical padding actually feels too roomy too.

As far as use cases,
Code:
[/c] still remains. So I don't think long phrases or multi-line stuff is actually in scope. For that you'd just split it out into a full block. This is more meant to be to have quick commands and snippets highlighted in discussion. The original inspiration here was stuff always put in quotes and then having to say "oh but not with the quotes" every single time and "that bit isn't part of the command" and so on.