axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: Axiom HyperDoc Replacement


From: Martin Rubey
Subject: Re: [Axiom-developer] Re: Axiom HyperDoc Replacement
Date: 21 Apr 2007 16:20:26 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"Bill Page" <address@hidden> writes:

> Oh ... Now that I have had a cup of coffee and woken up a
> little, [...censored...]
> That is an excellent idea.

Thanks.

> Instead of 'foo' let's just call this little Lisp function
> the 'server' and 'bar' is called the 'socket'.

OK, that makes sense.

> Since what we want is a browser interface for the desktop
> why not just use the local file system?

Yes, that's the idea.  In fact, I also want to do some caching, since tex4ht is
rather slow: every function has - by design of axiom - a unique identifier,
namely its signature.  I will use this as the name of the file.  Now, if the
file is there, it can be displayed immediately, otherwise I'll generate it.

> For an automatic redirection all you really need is something like this:
> 
>   (defun server (s)
>     (let* ((get (read s nil 'eof))
>            (fn (and (eq get 'get) (read-line s nil 'eof))))
>       (format s "HTTP/1.1 ~S~%" (if fn 303 403))
>       (format s "Location: ~S~%~%" (SPADCALL fn *docfun*))
>       (close s))) 

that's what I wanted.  


Unfortunately, it doesn't work.  Neither does  

(defun server (s)
   (let* ((get (read s nil 'eof))
          (fn (and (eq get 'get) (read-line s nil 'eof))))
     (format s "HTTP/1.1 ~S~%" (if fn 200 403))
     (format s "Content-type: text/html~%~%")
     (format s "<a href='~S'>click here</a>~%" (SPADCALL fn *docfun*))
     (close s)))

The latter just makes the browser display

Content-type: text/html

<a href='"stretch.html"'>click here</a>

i.e., it doesn't interpret the html.  The former doesn't find "stretch.html" in
the local directory.  Very likely it is looking for

localhost:8080/stretch.html

or some such.


Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]