Jump to content

[News] A tip for an easier-to-read post

When you insert long chunks of code

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

[News] A tip for an easier-to-read post When you insert long chunks of code Rate Topic: -----

#1 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 17 October 2006 - 09:34 AM

While this is certainly not a requirement, I'd like to let you all know of a little-known IPB feature: When you are inserting code into your post, you typically use the IPB wrapper called [ code ] (without the spaces). This is nice because it allows you to show other visitors some code you do not want rendered by the web browser.

What if you have a large list of code? There is no other option is there? The graphical toolbar directly above the post-text-box only shows bold, italic, ..., quote, and code, right? You'd be forced to make a post that is 39 meters high.

But ahar! I am here to free you from the constraints put upon your withering soul!

If you insert a large amount of code, don't use the IPB wrapper [ code ], instead use [ codebox ], and you'll see that a wonderful scrolling text box is provided, and your 39 meters of code fits wonderfully in a smaller, more readable area.

Here is an example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="web design forum, web development forum, web help, web discussion, website help, website forum, web design help" />
<meta name="description" content="Web design forum | web development forum | web help on a large range of web related topics. Including website critique, seo advice and coding techniques." />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<title>Webradiance -> Editing Post  [News] A tip for an easier-to-read post</title>
<link rel="alternate" type="application/rss+xml" title="Webradiance Recent Topics" href="http://www.webradiance.com/index.php?act=rssout&amp;id=1" />
 
<style type="text/css" media="all">@import url(http://www.webradiance.com/style_images/css_3.css);</style> 
<!--[if lte IE 6]> 
<style type="text/css">
<!--
#logostrip {
	height: 107px;
}
-->
</style>
 <![endif]-->
 
</head> 

<body>
<div id="ipbwrapper">
<!--ipb.javascript.start-->
<script type="text/javascript">
 //<![CDATA[
 var ipb_var_st            = "0";
 var ipb_lang_tpl_q1       = "Please enter a page number to jump to between 1 and";
 var ipb_var_s             = "";
 var ipb_var_phpext        = "php";
 var ipb_var_base_url      = "/index.php?";
 var ipb_var_image_url     = "/style_images/skin_webr~";
 var ipb_input_f           = "17";
 var ipb_input_t           = "443";
 var ipb_input_p           = "4225";
 var ipb_var_cookieid      = "";
 var ipb_var_cookie_domain = ".webradiance.com";
 var ipb_var_cookie_path   = "/";
 var ipb_md5_check         = "31a4e7af14ded9c4cfeb6a5653581fb6";
 var ipb_new_msgs          = 0;
 var use_enhanced_js       = 1;
 var use_charset       = "iso-8859-1";
var ipb_myass_chars_lang = "Not enough characters";
 //]]>
</script>
<script type="text/javascript" src='/jscripts/ipb_global.js'></script>
<script type="text/javascript" src='/jscripts/ips_menu.js'></script>
<script type="text/javascript" src='/style_images/skin_webr~/folder_js_skin/ips_menu_html.js'></script>
<!--ipb.javascript.end-->
<div class="page">
	<div id="top-rounded-row">
		<div id="tl-corner"><!-- Do not delete this div, it holds the top left rounded corner image --></div>

		<div id="tr-corner"><!-- Do not delete this div, it holds the top right rounded corner image --></div>
	</div>
	<div id="logostrip"><a href="http://www.webradiance.com/"><img src="/style_images/skin_webr~/webradiance_logo.gif" width="437" height="106" border="0"></a></div>
<div id="substrip">
	<!--ipb.leftlinks.start-->
	<ul id="float-left">
		&nbsp;<li><a href="http://www.webradiance.com/rules.html">WebRadiance Guidelines</a><li>
	</ul>
	<!--ipb.leftlinks.end-->

	<ul id="float-right"><li><a href="http://www.webradiance.com/links/">Links</a></li>	<li><a href="http://www.webradiance.com/help/">Help</a></li>
		<li><a href="http://www.webradiance.com/index.php?act=Search&amp;f=17">Search</a></li>
		<li><a href="http://www.webradiance.com/members/view-memberlist.html">Members</a></li>
		<li><a href="http://www.webradiance.com/index.php?act=calendar">Calendar</a></li>
		<!--ipb.rightlinks.end-->

	</ul>
</div>
</div>
</div>
</body> 
</html>



All praise the [ codebox ] wrapper!
0

#2 User is offline   Catalyst 

  • Codesmith
  • Group: Administrators
  • Posts: 1,049
  • Joined: 04-April 06
  • Gender:Male
  • Location:San Diego

Posted 17 October 2006 - 02:24 PM

Yarr, nicely done. I was wanting that for moojoo's thread.
0

#3 User is offline   Ben Abrams 

  • The buddy system:never fails
  • Group: Administrators
  • Posts: 1,850
  • Joined: 04-April 06
  • Gender:Male

Posted 17 October 2006 - 08:57 PM

i think in future we should look at automaticly using codebox for code elelements longer then 'x' amount of lines....great ipb feature though

View PostSirkent, on 21 September 2007 - 04:26 AM, said:

<monty python high-pitched female voice>I DON'T LIKE SPAM!</monty python high-pitched female voice>
0

#4 User is offline   william 

  • SEO Specialist
  • Group: Members
  • Posts: 233
  • Joined: 13-October 06
  • Gender:Male
  • Location:Gloucestershire, UK
  • Interests:SEO, Web Design, PHP Development, Wordpress, Fireworks, Photoshop, EpiServer

Posted 18 October 2006 - 07:27 AM

View Postbenbramz, on Oct 18 2006, 02:57 AM, said:

i think in future we should look at automaticly using codebox for code elelements longer then 'x' amount of lines....great ipb feature though



Good call. Yeah, great feature none the less. :thumbup:
0

#5 User is offline   James Mitchell 

  • Legendary
  • Group: Administrators
  • Posts: 922
  • Joined: 26-July 06
  • Gender:Male
  • Location:Fort Wayne, IN

Posted 18 October 2006 - 09:05 AM

That is an excellent tip and suggestion.
Posted Image
0

#6 User is offline   Ben Abrams 

  • The buddy system:never fails
  • Group: Administrators
  • Posts: 1,850
  • Joined: 04-April 06
  • Gender:Male

Posted 19 October 2006 - 07:02 PM

View Postbenbramz, on Oct 18 2006, 02:57 AM, said:

i think in future we should look at automaticly using codebox for code elelements longer then 'x' amount of lines....great ipb feature though

View PostJPMitchell, on Oct 18 2006, 03:05 PM, said:

That is an excellent tip and suggestion.
im not enjoying codebox though...id love to see some form of codebin with proper syntax highlighting and line numbers...we discussed this as a possible mod in the later life of the forums....looking at the awful codebox i think it could be worth looking at again....lol

View PostSirkent, on 21 September 2007 - 04:26 AM, said:

<monty python high-pitched female voice>I DON'T LIKE SPAM!</monty python high-pitched female voice>
0

#7 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 19 October 2006 - 07:34 PM

View Postbenbramz, on Oct 19 2006, 08:02 PM, said:

im not enjoying codebox though...id love to see some form of codebin with proper syntax highlighting and line numbers...we discussed this as a possible mod in the later life of the forums....looking at the awful codebox i think it could be worth looking at again....lol

Yeah, that would be a welcome addition, have we checked if a mod already pre-exists?

Also, what about the codebox do you not like, is it merely the lack of line numbers and syntax highlighting, or is it also the size of the window?
0

#8 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 20 October 2006 - 04:27 AM

I think the codebox suffers because you have both vertical and horizontal scrolling and yes, there's no syntax highlighting, line numbers, etc.

We did discuss creating some sort of codebin and I've started work on the syntax highlighting stuff, but I'm currently taking a short rest before I get back into it because I only just finished a load of other stuff, as we all know :).
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#9 User is offline   Ineke 

  • Shortcut Freak
  • Group: Members
  • Posts: 493
  • Joined: 04-August 06
  • Gender:Female
  • Location:Romsey!

Posted 20 October 2006 - 04:43 AM

Quote

I only just finished a load of other stuff, as we all know

do we? :S

sorry im so nosy :-#
Do not worry about tomorrow, for tomorrow will worry about itself. Each day has enough trouble of it's own.
PS: Here's my website!
0

#10 User is offline   benbacardi 

  • Administrator
  • Group: Administrators
  • Posts: 1,140
  • Joined: 06-April 06
  • Gender:Male
  • Location:United Kingdom

Posted 20 October 2006 - 06:23 AM

View Postineke, on Oct 20 2006, 10:43 AM, said:

do we? :S

The recent updated FURLS... ?
0

#11 User is offline   ShakingSpirit 

  • Pedantic Whinger
  • Group: Members
  • Posts: 237
  • Joined: 01-August 06
  • Gender:Male
  • Location:Southampton, UK

Posted 21 October 2006 - 11:36 AM

Am I the only one who hates codeboxes? :blink: I just need to be able to see all the code at once, and navigating two scrollbars is pain >_< On other forums I always end up copy&pasteing into notepad >_<
QUOTE(MSN)
Benbramz says: i had orgasmic thoughts at the excitement of that
0

#12 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 21 October 2006 - 10:51 PM

You might not be the only one, to be honest. I personally enjoy them for the sake of ease when reading a thread, and I always was the type to also copy/paste into some code app of mine.
0

#13 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 22 October 2006 - 04:04 AM

ShakingSpirit - would you prefer the code (if there's a lot of it) to open in a new window?
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#14 User is offline   ShakingSpirit 

  • Pedantic Whinger
  • Group: Members
  • Posts: 237
  • Joined: 01-August 06
  • Gender:Male
  • Location:Southampton, UK

Posted 24 October 2006 - 04:11 PM

That would be good if the syntax highlighting and code spacing is improved a bit (I'm sure there must be some hacks for that out there you can borrow bits of code from ^_^), otherwise I'd just prefer to have them attach it, and just view it in my own IDE.

Now, a codebox where you could click the top bar to view the code in a new window and/or download it? That would be just about perfect :D

This post has been edited by ShakingSpirit: 24 October 2006 - 04:11 PM

QUOTE(MSN)
Benbramz says: i had orgasmic thoughts at the excitement of that
0

#15 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 24 October 2006 - 04:14 PM

Ok, I think this'll be the next thing for me to work on then ;)

Watch this space... I'll probably try to get more opinions/ideas so that the solution pleases as many people as possible.
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#16 User is offline   marcamos 

  • W.R. General
  • Group: Administrators
  • Posts: 2,849
  • Joined: 04-April 06
  • Gender:Male
  • Location:Massachusetts - USA

Posted 24 October 2006 - 04:18 PM

Wow, that would be awesome Karl.
0

#17 User is offline   Ineke 

  • Shortcut Freak
  • Group: Members
  • Posts: 493
  • Joined: 04-August 06
  • Gender:Female
  • Location:Romsey!

Posted 24 October 2006 - 04:23 PM

if u wer looking for a proper challenge and *really* wanted to please everyone you could make it something that each user picks in their preferences!
i'm not trying to be annoying, honest! hehe :S
Do not worry about tomorrow, for tomorrow will worry about itself. Each day has enough trouble of it's own.
PS: Here's my website!
0

#18 User is offline   moojoo 

  • Argh!
  • Group: Members
  • Posts: 449
  • Joined: 03-August 06
  • Location:Texas

Posted 25 October 2006 - 11:21 AM

Any way to have a link of sorts to open code in the source view of the browser? or is that just stupid?

This post has been edited by moojoo: 25 October 2006 - 11:21 AM

Its not girly, its web 2.0!
0

#19 User is offline   Karl Buckland 

  • A.K.A. Sirkent
  • Group: Administrators
  • Posts: 2,145
  • Joined: 04-April 06
  • Gender:Male
  • Location:Kent, UK

Posted 25 October 2006 - 12:05 PM

View Postmoojoo, on Oct 25 2006, 05:21 PM, said:

Any way to have a link of sorts to open code in the source view of the browser? or is that just stupid?

I don't believe there's an agreed standard way of doing that, but besides... our way will have syntax highlighting and make it easy for you to copy out of the page, so it'll be almost as good :)

View Postineke, on Oct 24 2006, 10:23 PM, said:

if u wer looking for a proper challenge and *really* wanted to please everyone you could make it something that each user picks in their preferences!
i'm not trying to be annoying, honest! hehe :S

What preferences would users be able to choose?
QUOTE(benbramz @ Aug 17 2007, 07:44 AM) Ive noticed that quite a few people are now adding quotes from the board into their signature. I think its started an new web-radiance craze.. :P
0

#20 User is offline   Ineke 

  • Shortcut Freak
  • Group: Members
  • Posts: 493
  • Joined: 04-August 06
  • Gender:Female
  • Location:Romsey!

Posted 25 October 2006 - 12:20 PM

like whether they had the scroll boxes, whether it just showed it all, whether it opened in a new window etc

wow i didnt expect to be taken seriously :P
i hav no idea how plausible ne of that is
Do not worry about tomorrow, for tomorrow will worry about itself. Each day has enough trouble of it's own.
PS: Here's my website!
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users