Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Syntax Highlighting For Code
sonesay
post Aug 1 2008, 11:27 PM
Post #1


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 689
Joined: 20-June 07
From: Auckland
Member No.: 45,102



Hey all, I'm not sure if its been brought up but I couldn't find any topics on this. Has anyone brought up the idea of updating the [code][/code] blocks to allow syntax highlighting? This would be a nice feature to have but I don't know if its something that can be easily added on. I don't know about you guys but when I see long blocks of code in the same color from users I just don't want to read them. Especially when they are put in a small box container about 100px high and I have to scroll through it. Making code easier to read would help a lot.

Peace
Sone.
Go to the top of the page
 
+Quote Post
jlhaslip
post Aug 1 2008, 11:36 PM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,077
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



There is an HTML and an SQL BBcode tag already on the system.

HTML
<h2>Tab Menu 1</h2>

<div id="menu1">

<ul>
<li><a href="#1" title="Link 1">Link 1</a></li>

<li><a href="#2" title="Link 2">Link 2</a></li>

<li><a href="#3" title="Link 3">Link 3</a></li>

<li><a href="#4" title="Link 4">Link 4</a></li>

<li><a href="#5" title="Link 5">Link 5</a></li>

</ul>

</div>

<br />


SQL
// This file contains the database access information.
// This file also establishes a connection to MySQL and selects the database.
// This file also defines the escape_data() function.

// Set the database access information as constants.
DEFINE ('DB_USER', 'username');
DEFINE ('DB_PASSWORD', 'password');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'sitename');

// Make the connection.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() );

// Select the database.
@mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() );

Go to the top of the page
 
+Quote Post
sonesay
post Aug 1 2008, 11:41 PM
Post #3


|||[ n00b King ]|||
*********

Group: [HOSTED]
Posts: 689
Joined: 20-June 07
From: Auckland
Member No.: 45,102



Oh thanks for that information I didn't know they existed. That's good having syntax highlighting for that but I was hoping we could get them for some other languagues like PHP, Java, Javascript, C, C++ and what ever else is out there.
Go to the top of the page
 
+Quote Post
galexcd
post Aug 2 2008, 06:16 AM
Post #4


Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software.
***********

Group: [HOSTED]
Posts: 1,076
Joined: 25-September 05
From: Los Angeles, California
Member No.: 12,251



Well syntax highlighting for php should be fairly easy seeing as php has a built in function to do it for you. highlight_string(). An admin would just have to add a new bbcode tag that ran all inclosing text through that function.
Go to the top of the page
 
+Quote Post
pedro-kun
post Aug 2 2008, 12:44 PM
Post #5


Member [Level 1]
****

Group: [HOSTED]
Posts: 69
Joined: 30-July 08
From: Portugal
Member No.: 65,749



QUOTE(galexcd @ Aug 2 2008, 07:16 AM) *
Well syntax highlighting for php should be fairly easy seeing as php has a built in function to do it for you. highlight_string(). An admin would just have to add a new bbcode tag that ran all inclosing text through that function.

Not only that, but there are really nice plugins for almost every board type which can highlight *many* languages. It'd be a really nice function, I guess. I bet the folks back at the coding sections would love it ;)
Even though it is Python-based, there's a cool highlighter called Pygments... It works pretty fine (even though there are bugs, of course).
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Coupon Code(5)


 



- Lo-Fi Version Time is now: 7th October 2008 - 03:29 PM