[PRL] Re: prl page
Dave Herman
dherman at ccs.neu.edu
Sun Jun 27 22:40:03 EDT 2004
> - If I use DrScheme, can I make a web page by writing some
> S-expressions rather than raw html?
I thought you'd never ask! :)
I write some of my web pages as S-expressions using PLT Scheme. I
believe Matthias does, too.
You have several options, because there is more than one implementation
of XML and HTML as S-expressions. PLT Scheme comes with the "xml" and
"html" collections, but Oleg Kiselyov also has some neat libraries
called SSAX, which includes an XML-as-sexps library called SXML, and a
transformation library that does pattern matching on SXML trees and
works kind of like macros.
SSAX home page:
http://ssax.sourceforge.net/
PLT port of SSAX:
http://www196.pair.com/lisovsky/xml/ssax/
The reason I like using this library is because for each page (or set of
similar pages) I design a little data language that best fits that
particular design, and then I write a transformer to convert the page
into SXML. (Then the libraries can convert it to XHTML.)
> - Assuming the answer is yes, could you please tell me how to do it?
> I would appriciate if you could give me a sample file, how to compile
> it into html (on Macintosh), which part of the document (in DrScheme
> manual?) I should read, and how to include the message "powered by
> DrScheme."
I really need to package my libraries up, update them to work with the
latest version of SSAX, and write some HOWTOs (i.e., exactly what you're
asking for). I will try to do this soon, and I'll let you know when I do.
Meanwhile, if you want to look at how my pages currently work, have a
look at:
The little libraries I've written:
~dherman/.www/source/transform.ss
~dherman/.www/source/www.ss
The sources for a couple of my web pages:
~dherman/.www/source/index.sxml
~dherman/.www/source/code.sxml
The scripts that generate the XHTML output:
~dherman/.www/source/index.scm
~dherman/.www/source/code.scm
(There's a readme in that directory but it's completely outdated.) As I
said, some pieces are kind of hacked together. Undoubtedly it's not all
self-explanatory, so let me know if you have any questions.
Dave
More information about the PRL
mailing list