Re: Export to HTML in CLI?

"Greg Rundlett" <[email protected]>
Newsgroups gmane.comp.kde.devel.quanta.user
Message-ID <[email protected]>
On Fri, Jan 9, 2009 at 6:54 AM,  <[email protected]> wrote:
> I mean to take advantage of the source code highlighting capabilities. If I
> have a PHP document I'm working on, I can export to HTML to preserve, among
> other things, coloring. Is this possible from the command line?
>
> Thanks.

Here are a few options:

If you want to use PHP to output a syntax-highlighted (using HTML)
version of your source, see
http://us3.php.net/manual/en/function.highlight-string.php
http://us3.php.net/manual/en/function.highlight-file.php

If you just want people to view your source files, also see the phps
configuration option for the webserver (where any file ending with the
extension ".phps" is returned to the browser as syntax-highlighted
rather than parsed by mod_php)

If you have more languages than PHP, HTML, CSS, JS; and/or you want to
do something integrated with an existing blog/cms/wiki; and/or want to
leverage existing work rather than re-inventing the wheel, I'd
recommend GeSHi
http://qbnz.com/highlighter/

There is also gnu enscript

Note too: many projects from MediaWiki to Drupal to WebSVN have
modules that incorporate one or more of these approaches.

wow, I guess I'm kinda a highlighting junkie

-- 
Greg Rundlett
Web Developer - Initiative in Innovative Computing
http://iic.harvard.edu
m. 978-764-4424
o. 978-225-8302
skype/aim/irc/twitter freephile
http://profiles.aim.com/freephile
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.