Fog Creek Software
Discussion Board




Syntax highlighter?

Does anyone know of a good program that can take a text file and syntax highlight it, then export the syntax highlighted file in HTML?
The text editors I've looked at so far (and Ultraedit, my personal favorite) do good jobs of highlighting, but there's no way to get the highlighting out of the editor (for use in another program)

(I'm trying to put syntax highlighted C# & SQL in Help & Manual...)

thanks!
Philo

Philo
Saturday, August 30, 2003

SciTE (from www.scintilla.org) is an opensource text editor with syntax highlighting.
When you select some code in SciTE, you can copy it as RTF (with all the colors and the beautiful formatting) and move it next to an RTF > HTML converter (I use WinWord for that).

FireMode
Saturday, August 30, 2003

SciTe will also save as HTML. It's pretty bloated HTML but it works well.

Damian
Saturday, August 30, 2003

SWEET! That is *exactly* what I need - thanks!

Philo

Philo
Saturday, August 30, 2003

Try CodeSense:

http://www.ticz.com/homes/users/nlewis/

It is based on CodeMax.  My company has just finished integrating it into our newest product and it works fantastic.  It is a Windows DLL and includes source code and is FREE.  It is also very easy to add new features to.

Brett Kapilik
Saturday, August 30, 2003

My favourite editor...

www.codegenie.com

Supports both RTF and HTML export of highlighted files.

Wayne Venables
Saturday, August 30, 2003

http://www.code-genie.com/

Looks interesting, but I think scite is doing what I need.

But of interest at the codegenie site:
"Source code: Code-Genie is an open-source program, so you can get its source code, too. Its price is 3800 Euro. For this price you get the source code that compiles to the latest version of the program present on this site."

Hrm. Is it open-source if you have to buy the source?

Philo

Philo
Saturday, August 30, 2003

If the source's license is GPL, after you buy the source, you have almost the exact same rights as the authors, so you can start giving away the software yourself.

Joy
Saturday, August 30, 2003

You might also want to take a look at Code2HTML ( http://www.palfrader.org/code2html/examples.html ), a perl script that exports syntax highlighted HTML for a whole range of languages.

Roel Schroeven
Saturday, August 30, 2003

It certainly isn't "open source" according to the OSI's "Open Source Definition", which you can find at http://www.opensource.org/docs/definition_plain.php . Unfortunately (maybe), the term "open source" isn't a trademark or anything, and no one can stop a company saying "This product is open-source: you can get the source code by paying us $1M, and then you aren't allowed to show it to anyone else" even though that's utterly incompatible with what the people who cooked the term up *want* it to mean.

Gareth McCaughan
Saturday, August 30, 2003

You most definitely CAN withhold the source from non-paying persons if you want, even under the GPL. What you can't do is prevent them from giving it away after they have it.

Classic example: Lindows. Based on Linux, but you can't get the binaries or accompanying source w/o paying for the product. Once you do, there's nothing stopping you from redistributing the GPL'd portions of the source code.

Brad Wilson (dotnetguy.techieswithcats.com)
Saturday, August 30, 2003

jedit ( http://www.jedit.org ) has a plugin that takes any open document and exports it to colourised html.  I use that for all my code snippets in documentation etc.

GPL of course, and a nice editor too.

i like i
Saturday, August 30, 2003

[ http://freshmeat.net ] is a good place to look for these things, as is [ http://sourceforge.net ]

Ori Berger
Saturday, August 30, 2003

A utility that will do this from the command line is enscript.

Daver
Sunday, August 31, 2003

and yet another...TextPad also supports this option (select the text you want to copy and choose Copy Other from the Edit menu).  The resulting HTML is fairly clean and, happily, uses CSS for its markup.  http://www.textpad.com

jburka
Tuesday, September 02, 2003

*  Recent Topics

*  Fog Creek Home