hello,
what is the best way to syntax highlight lisp code in html form?
that is, produce syntax highlighted lisp code from text to html tags.
there are a ton of tools like this for c and c++, but I have not seen
any for lisp. I want to be able to do this without converting my plain
text files with lisp code to TeX.
thanks,
-- john
IF FORTH HONK THEN
Sent via Deja.com http://www.deja.com/
Before you buy.
In article <············@nnrp1.deja.com>, ········@my-deja.com wrote:
> hello,
>
> what is the best way to syntax highlight lisp code in html form?
> that is, produce syntax highlighted lisp code from text to html tags.
> there are a ton of tools like this for c and c++, but I have not seen
> any for lisp. I want to be able to do this without converting my plain
> text files with lisp code to TeX.
I use vim and it works fine for doing this.
www.vim.org
-- Rahul
········@my-deja.com writes:
> what is the best way to syntax highlight lisp code in html form?
> that is, produce syntax highlighted lisp code from text to html
> tags. there are a ton of tools like this for c and c++, but I have
> not seen any for lisp. I want to be able to do this without
> converting my plain text files with lisp code to TeX.
If you have emacs installed, you could try htmlize.el by Hrvoje
Nicksic, available at <URL:http://jagor.srce.hr/~hniksic/htmlize.el>
From the source of htmlize:
;; This package analyses the text properties of the buffer and
;; converts them, along with the text, to HTML. Mail to
;; <·······@srce.hr> to discuss features and additions. All
;; suggestions are more than welcome.
;; To use, just switch to a buffer you want HTML-ized, and type `M-x
;; htmlize-buffer'. After that, you should find yourself in an HTML
;; buffer, which you can save. Alternatively, `M-x htmlize-file' will
;; find a file, font-lockify the buffer, and save the HTML version,
;; all before you blink. Even more alternatively, `M-x
;; htmlize-many-files' will prompt you for a slew of files to undergo
;; the same treatment. `M-x htmlize-many-files-dired' will do the
;; same for the files marked by dired.
Here's a sample:
Plaintext:
(defun annuity (pv r periods)
"Return the anniuty given present value PV, interest rate R,
and number of periods PERIODS."
(/ 1 (/
(/
(1-
(expt (1+ r) (- periods)))
r)
pv)))
Htmlized:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!-- Created by htmlize-0.49 in css mode. -->
<html>
<head>
<title>test.cl</title>
<style type="text/css">
<!--
BODY {
color: #000000;
background-color: #cccccc;
} /* default */
span.string {
color: #008b00;
} /* font-lock-string-face */
-->
</style>
</head>
<body>
<pre>
(defun annuity (pv r periods)
"<span class="string">
Return the anniuty given present value PV, interest rate R,
and number of periods PERIODS.</span>"
(/ 1 (/
(/
(1-
(expt (1+ r) (- periods)))
r)
pv)))
</pre>
</body>
</html>
--
chr
In article <············@nnrp1.deja.com>,
········@my-deja.com wrote:
> IF FORTH HONK THEN
... will cause a stack underflow.
try this instead:
FORTH IF HONK THEN
Sent via Deja.com http://www.deja.com/
Before you buy.