[racket] scribble to stdout
I wonder whether I can use scribble as script a scripting
language, to generate html on the fly. Consider the
following minipage:
http://advocacia.me/rkt/pages.r
Here is the script that generated it:
#!/usr/bin/env racket/bin/racket
#lang racket
(display (~a "Content-type: text/html
<html>
<body>
<h1>Racket for CGI</h1>
<p>One often cannot use Racket to
serve html pages. Inexpensive
hosting services stick to
Apache, and that is it.</p>
<h2>CGI</h2>
Let us see how to use CGI from
Racket, etc. etc.
<h2>ssh</h2>
You need to get permission from
your hosting service to use ssh.
Then create a rkt folder, and
give it chmod a+x rkt permission.
Then create a .htaccess file, and
inform Apache abour Racket extensions...
<p>Addhandler .rkt .s .r</p>
<p>And that is all.</p>
</body>
</html>
"))
If the author of this minipage could write
scripts in scribble, it would become something
like this:
#!/usr/bin/env racket/bin/scribble --script
#lang scribble/base
@title{Racket for CGI}
One often cannot use Racket to
serve html pages. Inexpensive
hosting services stick to
Apache, and that is it.
@section{CGI}
Let us see how to use CGI from
Racket, etc. etc.
@section{ssh}
You need to get permission from
your hosting service to use ssh.
Then create a rkt folder, and
give it chmod a+x rkt permission.
bla, bla, bla...
I guess this feature is very easy to
implement, and would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130921/195733dd/attachment.html>