Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inline code tag
#1
Dear Santa,

My name is Ofnuts and I think I have been a good and well-behaved user and moderator during the past year (even if my PEP-8 grades aren't that good).

I know you have been very busy lately trying to fix your damaged sled, but once you are done, I would like something nice for Christmas that you can perhaps do with the help of Smop the coder elf, Pebkac the tester elf, and I18N the translating robot, if they aren't themselves busy working on the kid behavior monitoring firmware in the new Barbies and G.I.Joe's.

You see, at the top of the posting widget there are four symbols, 'B', 'I', 'U', and 'S'. I would like a fifth symbol, a '#' that says "Code" when your mouse is over it, and clicking it while some text is selected would set that text in some fixed-pitch font, in a slightly different color, or perhaps even on a slightly different background as done in markdown when you have backticks.

Then I would be able to distinguish between plain HTTP requests  and the requests module, and spend a while talking about the while statement, and in general include inline code elements in my text. Perhaps the others could benefit from this as well.

Hoping I'm not asking for the moon,

Yours faithfully,

Ofnuts

PS: No, plain Courier New isn't usable, it is ugly (and too small anyway).
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#2
Yeah, that would be pretty useful.
I'll probably take a look around and give implementing it a shot

I'm pretty busy, so it probably won't be super-soon (unless it's super-simple to do), and this stuff is probably implemented as just a huge regex mess (judging by my previous experience with php-based "parsers").
Reply
#3
Let's see if this works.
The word []code[] should look different...

Not sure how to add it to the editor, and don't have the time to find out right now, sorry...
Both the starting and ending tags are [`]
Creating this, I found a problem with MyCode parsing - other codes are being parsed even in code tags. That should probably be disabled... somehow.

If someone has a better idea for start/end tags, or different styling, go ahead and suggest it.
I thought of using plain [][`] to denote inline code, but that could be awkward, considering the problem I mentioned before.
Reply
#4
Why not something like [ icode] to mean inline code?  I don't like magic things, and a backtick feels pretty much like magic.

Or parse the code segment, and if no newlines are contained within, we do something special?
Reply
#5
(Dec-01-2016, 03:53 PM)stranac Wrote: Let's see if this works.
The word []code[] should look different...

Not sure how to add it to the editor, and don't have the time to find out right now, sorry...
Both the starting and ending tags are [`]
Creating this, I found a problem with MyCode parsing - other codes are being parsed even in code tags. That should probably be disabled... somehow.

If someone has a better idea for start/end tags, or different styling, go ahead and suggest it.
I thought of using plain [][`] to denote inline code, but that could be awkward, considering the problem I mentioned before.

I'll take anything, in another post I was mentioning the []correct[] variable and changing the typography was really necessary.

A good thing about the openSquareBracket-backtick-closeSquareBracket sequence is that on my AZERTY
keyboard all three are entered with the AltGr key, so the whole sequence is quite []fast[] to type.

Thanks for the advance Xmas. Can we start using it or should we wait for some dust to settle on the design?
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#6
I was thinking (if I manage to get around that problem), pf having both a tag such as as suggested by nilamo and plain backticks do this (because I prefer typing my posts instead of using buttons and I'm already used to the way SO does this).
That is, unless someone would mind that...
Reply
#7
(Dec-01-2016, 09:16 AM)stranac Wrote: Not sure how to add it to the editor, and don't have the time to find out right now, sorry...
You can take a look how other none standard button is implied in APC--> Configuration --> MyCode.
MyBB use MyCode and parsing in Config MyCode.

I have done some stuff MyCode,but metulburr has done almost all stuff with buttons.
So a inline code button can be added.
Think is best that metulburr do it,
remember that there where some Gotchas with adding buttons in editor.
(Dec-01-2016, 11:42 PM)Ofnuts Wrote: Can we start using it or should we wait for some dust to settle on the design?
Can look as some design,not to found of grey highlighted box.
Here a Pen that be played around with,
use a style that close to the other code boxes.
Reply
#8
i added an icode tag shown in sceditor as [] (not too creative in drawing buttons at this point). I made a few examples of different inline codes to use. Currently the icode button is linked with the last one. 


no inline [c]inline1 [ c ][/c] no inline

no inline [c2]inline2 [ c2 ][/c2] no inline

no inline [c3]inline3 [ c3 ][/c3] no inline

no inline [c4]inline3 [ c4 ][/c4] no inline (larger)

no inline icode [ icode ] no inline (what sceditor button is set as now). Personally my eyes read over this without registering the background difference at all.   
[anchor=custom_anchor][/anchor]

The position on where the button is within the sceditor is limited without too much hacking at the plugin. They are grouped together, and this is the "custom" button group location. Thus the reason why all our custom bbcode buttons are together. 

If you go to the stickied changlog thread in admins and mods, it describes the process of creating a custom BBcode button in detail.
Recommended Tutorials:
Reply
#9
(Dec-02-2016, 12:06 PM)metulburr Wrote: Personally my eyes read over this without registering the background difference at all. 
Look at this Pen also posted over,where i try some looks that are closer to other code boxes.
Reply
#10
that looks nice to me
Recommended Tutorials:
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question inline images rootsmusic 1 2,305 Apr-20-2022, 07:54 PM
Last Post: Axel_Erfurt
  inline Skaperen 0 1,625 Oct-13-2020, 07:16 PM
Last Post: Skaperen
  friendly redirect pages -> inline success msg metulburr 1 4,000 Sep-20-2016, 03:00 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020