Syntax coloring in code tags


Recommended Posts

I've always wondered if it was possible. For instance if I want to post Java code in the forum, I'd write

class Java // etc

which would display a bit like

class Java // etc

I think it would be a huge improvement for the readability of code; it would also encourage newcomers to use the code tags instead of quote like they often do.

It's just a suggestion of course, I've no idea how difficult it could be to implement. What do you guys think?

Link to comment
Share on other sites

I love this idea - it really would improve the programming forums.

When asking for help or helping users, it would be easier to refer to parts of code, as there would be line numbers, and it would also be much easier to read the code which is posted.

The link Rob posted seems like the best; also, this one allows for easy printing of code and for easily copying the code without line numbers (view source).

If I'm not mistaken, this one also allows you to put "=Java", or whatever language you are posting, inside the 'code' tags and whatever you put in there will be displayed in the title of that 'code' box. e.g.

Code here

Link to comment
Share on other sites

Well I'll bring it up with the other devs and powers that be, as the implementation would require some thought. Thanks for the suggestion :)

Link to comment
Share on other sites

People already ignore the HTML tags. ;)

<!-- Header Search Start -->
				<div id="header-search">
					<form action="https://www.neowin.net/forum/index.php?act=Search&CODE=01" method="post">
						<div id="header-search-box">
							<input type="hidden" name="forums" id="gbl-search-forums" value="all" /> 
							<input type="text" size="20" name="keywords" onfocus="gbl_check_search_box()" id="ipb-tl-search-box" />
						</div>


							<div id="header-search-sub">
								<label for="gbl-search-checkbox"><input type='checkbox' id='gbl-search-checkbox' value='1' onclick='gbl_check_search_box()' checked="checked" />Search this forum only?</label>
							</div>

					</form>
				</div>
				<!-- // Header Search End -->
				<!-- Header Banner Start -->
				<div id="header-banner">

					<div id="rev-fullbanner">
						<script type="text/javascript">
						<!--
							google_ad_client = "pub-8662354728915461";
							google_ad_slot = "8363172501";
							google_ad_width = 468;
							google_ad_height = 60;
						//-->
						</script>
						<script type="text/javascript" src="https://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
					</div>
				</div>
				<!-- // Header Banner End -->
				<div class="clear"></div>
			</div>

Link to comment
Share on other sites

What I'm saying is that this would get just as lost in shuffle, except for the experts. All BBCode tags in use on this board are in the BBCode help link.
I disagree. Most people who post in the Programming board are programmers and already use the code tags. If it was implemented as an attribute for the code tag (
Link to comment
Share on other sites

I disagree. Most people who post in the Programming board are programmers and already use the code tags. If it was implemented as an attribute for the code tag (
), it would be easy to get used to. As soon as someone would see syntax-highlighted code in the forum, he'd want his posts to look the same.

At least I would :p . Who's in support of the idea?

Yes, they use the code tags. But never the HTML. I support the idea, but you'll find it used very sparingly.

Link to comment
Share on other sites

If we do implement it, I think a concerted staff effort to follow your example Joel, in editing posts where an incorrect BBCode is used, would be beneficial.

Link to comment
Share on other sites

  • 1 month later...
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.