By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,639 Members | 3,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,639 IT Pros & Developers. It's quick & easy.

Wanted: Syntax-colouring scripts?

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.