PHP Developers Network
http://forums.devnetwork.net/

'inline code tag' (just using courier font or something)
http://forums.devnetwork.net/viewtopic.php?f=7&t=132200
Page 1 of 1

Author:  Apollo [ Mon Oct 17, 2011 11:11 am ]
Post subject:  'inline code tag' (just using courier font or something)

Instead of using [code] or [syntax=somelanguage] to include a block of code, it can be very convenient to just include a small piece of code (a single statement or something) 'inline', i.e. in the middle of your text.

No fancy markup required, to distinguish code from regular text it'd be enough if we could just use a courier new font or something. So you can include something Image within a sentence.

(done with an image here to show what I mean, you get the idea)

Author:  twinedev [ Mon Oct 17, 2011 3:36 pm ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

I agree, i end up just using bold to make it stand out, but displaying it as a fixed font would be nicer (especially when it comes to a bit that has a double and a single quote next to each other.)

Author:  pickle [ Mon Oct 17, 2011 4:46 pm ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

This should be relatively simple to do with a shortcode.

[Edit] [c] has been added. It wraps the text in <code> tags

Author:  twinedev [ Mon Oct 17, 2011 5:21 pm ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

So this will be a code (testing it on the quick reply area)...
Syntax: [ Download ] [ Hide ]
$bNiceJob = ($this->works && $im->happy);


Sweet thanks.

Author:  social_experiment [ Tue Oct 18, 2011 10:09 am ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

What a coincidence, just a few minutes ago i made a post and wondered if the c behind Font colour was there because the page didn't finish loading but now i know :) I agree about its use, sometimes a block of code is just too heavy for a single line within a reply.

Author:  pickle [ Tue Oct 18, 2011 4:22 pm ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

I've updated the tag to [inline] as it was getting mixed up with the syntax highlighting plugin. It appears to still be broken if you surround a function name, or more specifically "()" in the tags - so let's consider this a "beta" feature for know.

Author:  Apollo [ Fri Oct 21, 2011 4:43 am ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

Thanks, although it seems to mess up with pretty much any non-alphabetic character between the tags (e.g. vs [inline]this doesn't[/inline] because of the single quote). Perhaps some bbcode regexp is a bit too restricted currently? Same happens with : ; " # $ etc, so that makes it kinda useless for any actual code.

I noticed currently the [inline] tag evaluates to <code class="inline">, maybe it could just use <span class="inline"> for the time being, and later on back to <code> once it doesnt interfere with the syntax highlighting anymore? (I'd rather have non-syntax-highlighted inline code than not-working-at-all :)).

One more request: maybe to make the code stand out a bit more, make the background a bit brighter? Currently, the background color appears to be alternating #e1ebf2 and #ecf3f7, perhaps make the .inline css have background-color:#ffffff for example? (or .inlinecode if .inline is also used for other stuff)

Author:  pickle [ Mon Oct 24, 2011 11:16 am ]
Post subject:  Re: 'inline code tag' (just using courier font or something)

I've done no CSS modification for this, so there is certainly room for improvement. Maybe we'll have to find a plugin to do this, or modify the syntax plugin to allow for inline code, as evidently the quick-n-dirty BBCode solution isn't working as we wanted.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/