P
ParodyKnaveBob
Guest
Howdy, $:^ ]
I propose a new button for the GMC's text editor to facilitate mentioning code in prose without the user's need for lots of extra formatting. I'll demonstrate why this would be so tremendously useful. I'm writing "I" below as shorthand: I expect many of you Programming forum helpers are "I' just the same.
Preventing Forest Fires
Sure, all you need is to add a break in the with loop after arr_foes == other.id finds your target!
Uh-oh, now my post is broken. Lemme go edit everything by hand. All right, the italics are fixed, but what about my array that had i for the index? Maybe add a whole code block for one little mid-sentence mention?
Sure, all you need is to add a break in the with loop after
Code:
arr_foes[i] == other.id
Or, skip the simple sentence altogether and rewrite someone's whole code block, depriving one of mini-solving the exact place to write the exact keyword, vs. unthinking copy-paste? Or, corrupt the code by making it arr_foes{i} or arr_foes[ii] or what-have-you, potentially confusing someone, unless of course, I start writing more unnecessary text to explain? Or, perhaps I've dug up the Help page to learn I can wrap code in [plain][/plain], despite it not being in the toolbar, not even hidden (like the tucked-away "Code" option which so many new users clearly don't find) under the "Insert..." dropdown button? If I know the [plain] feature, at least I can get...
Sure, all you need is to add a break in the with loop after arr_foes[i] == other.id finds your target!
On the other hand, what if I had replied with [quote] blocks (or used an un/ordered list) in the broken post, too? When going back to edit, ~exhale~ so very much weird, broken formatting. Fixing that in the editor usually doesn't even stick because of irrelevant colors and alignments and what-all-else the editor adds (despite my not changing any colors, alignments, etc. in the first place). Painful. I pretty much have to fix all of that by hand-deleting lots and lots via the non-rich-text editor.
Oh, and if my old HTML 3.x days $;^ J influence me to write [plaintext] instead? Or, if I'm more used to [noparse] from other places online? Then, despite my "secret" (non-toolbar-advertised) knowledge, I still break the post, thus still get to edit the post to fix things, sometimes searching online to remember the proper Xenforo BB code to do so.
Likewise, I often inform newbies how to wrap code in code blocks, meaning I write more BB code to tell Xenforo not to parse the other BB code I do want to show.
Final miscellaneous note, I don't face the issue myself much, but I do see others getting emoji sporadically injected into their inline code.
Pretty Clear
Pretty and clear, actually. A few of us often designate inline code with a standard code font:
Sure, all you need is to add a break in the with loop after arr_foes == other.id finds your target!
Uh-oh, I broke the italics again. Redoing:
Sure, all you need is to add a break in the with loop after arr_foes[i] == other.id finds your target!
See how that font adds keyword clarity to the otherwise normal English words, break and with, mixed into the sentence, not to mention to the comparison expression? It's not necessary, but it's helpful, and it's pretty. However, to achieve this touch of polish, I must either A. type [font=Courier New][/font] around text or B. highlight text and press the Font Family dropdown button, then Courier New option. The toolbar option is faster, but that means I finish typing a section, remove hand from keyboard, use mouse to highlight text 1, reach up to toolbar, click, click, highlight text 2, reach back to toolbar, click, click, text 3, toolbar, click, click, return hand to keyboard, and get back to typing (hoping I haven't forgotten my next line of thought) -- or, type the whole post first before then scouring over it to add all my inline code highlights.
Presto!
One simple button could expedite writing and reading of little code bits. If that button existed, then it could easily add polish, too. I've demonstrated the why; now, I'll demonstrate the how.
What new keyword to use?
- [inline] is clear and memorable but perhaps lengthy, especially when peppering throughout a sentence or paragraph.
- [incode] is just as long and looks like confusion waiting to happen due to the mental homophone encode.
- [icode] is shorter but could easily create post-breaking typos due to [code].
- [ic] is super short, and I want to like it. It's probably as easily memorable as [b], [i], or [s] (the main one to type anyway). I hesitate for potential [i] typos, but I know I can be overly cautious, and this is maybe likely one of those times...
- Any better suggestions?
Unfortunately, I see no simple way to add a keyboard shortcut, but if it's easier to type out than to click, a keyboard shortcut doesn't matter that much anyway. See above spoiler regarding ease of typing. For the rest of this post, I'll use [ic] to designate inline code. That said, my example would go from...
~ fully written out ~
Sure, all you need is to add a [font=Courier New]break[/font] in the [font=Courier New]with[/font] loop after [font=Courier New][plain]arr_foes[i] == other.id[/plain][/font] finds your target!
~ partly written, partly WYSIWYG~
Sure, all you need is to add a break in the with loop after [plain]arr_foes[i] == other.id[/plain] finds your target!
...to...
Sure, all you need is to add a [ic]break[/ic] in the [ic]with[/ic] loop after [ic]arr_foes[i] == other.id[/ic] finds your target!
...and all in one go, the forum would protect and polish your code:
Sure, all you need is to add a break in the with loop after arr_foes[i] == other.id finds your target!
How much work would this require of YYG's GMC staff? Reviewing Xenforo's manual...
- Go to the BB code manager.
- Create a new keyword, IC.
- Title it Inline Code.
- Use simple replacement.
- No option support needed. (Unless someone suggests something brilliant? heheheh)
- Set the HTML to <span style="font-family: 'Courier New', monospace">{text}<span>. I suggest adding that "monospace" in the unheard-of event that a browser with HTML4+ capability sits on a computer with no Courier New font. ~shrug~
- Choose whatever button icon thingy you like. ?
- Example usage: This is [IC]inline code[/IC]. ("This is [IC]inline code[/IC] text." doesn't sound right to me. Perhaps "This text is [IC]inline code[/IC]." despite not 100% matching the other examples.) I doubt >0.1% of users read this page anyway, lol.
- Allow in signatures.
- No RegEx needed if no option support.
- No parsing smilies, hyperlinks, or other BB code. $:^ P
- I have guesses about line break conversion and trimming, but I've never managed Xenforo. This also means I can't comment on the advanced options. That said, I suggest line breaks within should be parsed normally, and a button would only need to insert [IC][/IC] into the textbox -- not pop open a dialog like the Media or Insert...->Spoiler/Code buttons.
- Winning! (Okay, I just enjoy 13 and wanted to round up the list nicely.)
Regards,