2:0
top
← prev up next →

rws-html-template: Racket Web Server html-template SupportπŸ”— i

Neil Van Dyke

License: LGPLv3 Web: http://www.neilvandyke.org/racket/rws-html-template/

1IntroductionπŸ”— i

This rws-html-template package helps use the SXML-based html-template package with the Racket Web Server. Specifically, it provides a response/html-template syntax that can be used like html-template, but producing a Racket Web Server response value.
As a quick example, here’s the next hot dotcom:
(requirerws-html-template)
(define(startreq)
(response/html-template
(html(header(title"advice-pin-oogly-book-r.com"))
(body(h1"Today's Advice")
(p"Don't run with "
(%(random-list-element'("scissors"
"cheese graters"
"toilet plungers"
"trays of lasagna"
"wolves"
"the bulls"
"cats")))
".")
(p"Like us on Facebook for a chance to win $"
(%(+100(random901)))
".")))))
(define(random-list-elementlst)
(list-reflst(random(lengthlst))))

2InterfaceπŸ”— i

syntax

( response/html-templatemaybe-code
maybe-message
maybe-seconds
maybe-mime-type
maybe-headers
maybe-cookies
maybe-preamble
content...)
maybe-code =
| #:codenumber?
maybe-message =
| #:messagebytes?
maybe-seconds =
| #:secondsnumber?
maybe-mime-type =
| #:mime-type(or/c#fbytes?)
maybe-headers =
| #:headers(listofheader?)
maybe-cookies =
| #:cookies(listofcookie?)
maybe-preamble =
| #:preamble(or/cbytes?string?)
Like html-template, but producing a Racket Web Server response value.

3Known IssuesπŸ”— i

  • Rework response/html-template to use new features in package version html-template version 2, which were developed specifically to support optimizations for this package.

  • Add #:ordering argument to response/html-template, probably implemented using more general support in package html-template. Once that’s finalized, implement the Content-length computation placeholder code.

4HistoryπŸ”— i

  • Version 2:0 — 2016εΉ΄02月25ζ—₯
    • Converting PLaneT web-server-xexp package to rws-html-template package in new package system.

  • Version 1:0 — 2013εΉ΄01月07ζ—₯
    • Early initial release, since needed by RackOut.

5LegalπŸ”— i

Copyright 2013, 2016 Neil Van Dyke. This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License,or (at your option) any later version. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See http://www.gnu.org/licenses/ for details. For other licenses and consulting, please contact the author.

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /