473,413 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Wanted: Syntax-colouring scripts?

Are there any syntax colouring scripts out there?

Ones where you provide the script with the path or URL of some source
file - and they return a web page containing correctly-coloured
source code?

I'd be particularly interested in a version in PHP that rendered
HTML/PHP/Javascript.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #1
5 2286
On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:
Are there any syntax colouring scripts out there?

Ones where you provide the script with the path or URL of some source file
- and they return a web page containing correctly-coloured source code?

I'd be particularly interested in a version in PHP that rendered
HTML/PHP/Javascript.

For PHP...
highlight_string()

and

highlight_file()
Don't know off hand about HTML and JS though.
HTH =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #2
Ian.H <ia*@windozedigiserv.net> wrote or quoted:
On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:

Are there any syntax colouring scripts out there?

Ones where you provide the script with the path or URL of some source file
- and they return a web page containing correctly-coloured source code?

I'd be particularly interested in a version in PHP that rendered
HTML/PHP/Javascript.


For PHP...

highlight_string()

and

highlight_file()

Don't know off hand about HTML and JS though.


That manages PHP - though not in my favourite colour scheme.

I see most others messing with the colours are post-processing the HTML
output of this function - aargh! :-(

An open source PHP script which did some decent rendering would be nice.

However at least this is a lot better than nothing at all ;-)
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #3
Tim Tyler <ti*@tt1lock.org> wrote or quoted:
Ian.H <ia*@windozedigiserv.net> wrote or quoted:
On Thu, 16 Oct 2003 19:44:42 +0000, Tim Tyler wrote:
Are there any syntax colouring scripts out there?

Ones where you provide the script with the path or URL of some source file
- and they return a web page containing correctly-coloured source code?

I'd be particularly interested in a version in PHP that rendered
HTML/PHP/Javascript.


For PHP...

highlight_string()

and

highlight_file()

Don't know off hand about HTML and JS though.


That manages PHP - though not in my favourite colour scheme.

I see most others messing with the colours are post-processing the HTML
output of this function - aargh! :-(


I hacked in someone else's colour changes and made a simple attempt to
dealt with HTML comments.

Example:
http://tt1.org/highlight/?9/index.php

The script:
http://tt1.org/highlight/?highlight/index.php

There is a great deal which could be done to improve legibility...
but I'm reluctant to do any more on the existing foundations.

If a colouring script is written it probably ought to be done properly -
rather than by post-processing some HTML spat out by another program in
a non-standard format.
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #4
On Thu, 16 Oct 2003 18:44:42 GMT, Tim Tyler <ti*@tt1lock.org> wrote:
Are there any syntax colouring scripts out there?

Ones where you provide the script with the path or URL of some source
file - and they return a web page containing correctly-coloured
source code?

I'd be particularly interested in a version in PHP that rendered
HTML/PHP/Javascript.


It's not PHP, but webcpp is good at syntax colouring.

http://webcpp.sourceforge.net/

Easy enough to call from PHP.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #5
I wrote a PHP syntax highlighter that handles HTML:

http://mandala.co.uk/syntax_highlighting/
--
__________
|im |yler http://timtyler.org/ ti*@tt1lock.org Remove lock to reply.
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
by: Damian Brown | last post by:
www.phpexpert.org
2
by: David McNab | last post by:
Hi, I'm looking for adventurous pre-alpha testers for a DHTML (active website) framework for Python I've developed. Name: - pyWeb Features:
3
by: Siegfried Heintze | last post by:
I'm displaying information on job postings in various cities. For example, might have a dozen jobs in Atlanta GA and I decide, at run time, that I don't want to see them. How do I set my DataView...
3
by: Manuel | last post by:
I'm trying to compile glut 3.7.6 (dowbloaded from official site)using devc++. So I've imported the glut32.dsp into devc++, included manually some headers, and start to compile. It return a very...
3
by: Gert v O | last post by:
Can someone help me parsing this ms-access PIVOT sql-statement to a ms-sql-server sql-statement? Many thanks in advance TRANSFORM Count(KlantenStops.id) AS AantalVanid SELECT...
63
by: Jake Barnes | last post by:
In the course of my research I stumbled upon this article by Alex Russel and Tim Scarfe: http://www.developer-x.com/content/innerhtml/default.html The case is made that innerHTML should never...
1
by: mattmao | last post by:
I am brand new to C#.NET so here is my trial on this lab exercise: using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace lab02exec { ...
14
by: Egbert Teeselink | last post by:
Hi all, The last few months I've worked on making a template engine because the ones out there didn't serve my needs. I guess everybody knows Smarty and has an opinion on it; I like many things...
5
by: =?Utf-8?B?U2llZ2ZyaWVkIEhlaW50emU=?= | last post by:
Can someone help me convert this to the latest C# syntax using predicate/delegate? You can see my attempt in the comments. Also: how would I set a new font for q_ul? q_ul is a WPF TextBlock and I...
6
by: Christopher Vogt | last post by:
Hej everybody, I built something for myself that might help some of you as well. Looking at a couple of PHP template engines made me think. I have two main requirements for a presentation...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.