PEngines application HTML

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PEngines application HTML

Carlo Capelli-2
Hi All

Since I do prefer html_write to plain HTML coding, I wonder if Pengines
applications support the usual :- http_handler and friends.

The tutorial suggests we should go with HTML, and I think I could hack the
schema doing HTML generation when registering the application module. But I
don't like too much...

thanks Carlo
-------------- next part --------------
HTML attachment scrubbed and removed
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PEngines application HTML

Torbjörn Lager-2
Hi Carlo,

Since I do prefer html_write to plain HTML coding, I wonder if Pengines
> applications support the usual :- http_handler and friends.
>

I tend to avoid generating HTML altogether and instead serve only static
HTML (and CSS and JavaScript) files. The pengine(s) needed for the
behaviour of the app is/are created by JavaScript in the static files. From
javascript you send queries (or input prompted for) to the server which
returns JSON which creates and controls the behaviour of the app. That's a
clean interface which also makes the division of labour between a front-end
programmer and a back-end programmer easy to uphold.

I doubt that you for safety reasons at this point can use the usual :-
http_handler and friends in code *injected* in a pengine by the
client/user. For code that you control yourself, anything is possible,
including the use of html_write. Using Pengines doesn't preclude the use of
*any* other libraries as far as I know.

Hope this helps.

Cheers,
Torbjörn


> The tutorial suggests we should go with HTML, and I think I could hack the
> schema doing HTML generation when registering the application module. But I
> don't like too much...
>
> thanks Carlo
> -------------- next part --------------
> HTML attachment scrubbed and removed
> _______________________________________________
> SWI-Prolog mailing list
> [hidden email]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
>



--
Torbjörn Lager
Professor of General and Computational Linguistics
Department of Philosophy, Linguistics and Theory of Science
University of Gothenburg
Box 200, SE-405 30 Gothenburg, Sweden
Phone: +46317864962
-------------- next part --------------
HTML attachment scrubbed and removed
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: PEngines application HTML

Anne Ogborn-2
HI Carlo -

I, on the other hand, love generating HTML.  You can inject the pengine javascript with a quasiquote in the normal manner, and html_requires  in the pengines script.

I suppose somebody should make a small pack that sugars this.
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Loading...