[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3 questions (portable HTTP server, GUI toolkit, HTML generation)



On May  4, Patrick Giagnocavo wrote:
> I also came across Eli Bazrahily's (spelling?) pages, that has some
> simple HTML generation code in it too. I have not had a chance to
> really dig into it yet.

I was about to mail something anyway.  (And at least the spelling
issue is clarified...)

What I have started as a simple thing I needed for making my pages
without using frames, and turned out to be pretty nice.  It doesn't
try to do what the XML collection is doing (and will do) and it is not
using it - it is just my small view of how I wanted to write my web
pages - I have some code like:

  (defhtml _drinks
    :name "drinks"
    :title "Coke machine votes"
    :body-extra-args '(:onLoad "update();")
    :contents
    (let ((drinks '((coke   "Classic Coke"       #t)
                    (cfcoke "Caffeine-free Coke" #f)
                    (dtcoke "Diet Coke"          #t)
                    [...]
                    (nestea "Nestea Cool"        #t)))
          (my-input:
           (lambda args
             (apply text-input: :readonly #t :size 2 :onChange "update();"
                    args))))
      [...]))

and every time I update that list of drinks and rerun the script, it
makes me feel good.  Instead of writing some more examples, you can
have a look at the files...

The main file is at

  http://www.cs.cornell.edu/eli/src/html.scm

and examples are (url-for-scheme-file --> url-for-results):

  1. http://www.cs.cornell.edu/eli/src/eli.scm
       --> http://www.cs.cornell.edu/eli/
     The source file for all my web pages - that's probably the most
     sophisticated usage...
     BTW - the example above is from a big voting form we had for the
     local coke machine - it's commented out so if you want to see how
     it looks like you have to run the script.

  2. http://www.cs.columbia.edu/nlp/nlp.scm
       --> http://www.cs.columbia.edu/nlp/
     A little similar to the above - a bunch of pages with a common
     menu thing, but much simpler.

  3. http://www.cs.columbia.edu/~regina/src/regina.scm
       --> http://www.cs.columbia.edu/~regina/
     My wife's home page - the simplest example of a single page
     thing.

There's also a guy that uses it to generate html pages at run time
from a database query results on some Windows application, I can tell
you more if you're interested...

BTW - if anyone is interested, I have some scripts that handle
automatic homework submissions.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
         http://www.cs.cornell.edu/eli/meaning.html        Maze is Life!