Maybe also look at Pollen's project server. Though intended primarily as a 
development tool, it basically amounts to a dynamic page-generation system that 
runs through the Racket web server. I haven't tried deploying it live, though 
there's no reason in principle that one couldn't.

As for files vs database, do whatever pleases you of course. But disk I/O is a 
small cost relative to dynamic rendering (which in Pollen relies on `eval`), so 
one doesn't save much by avoiding it. Also, for most websites, reads far 
outnumber writes. If every read hits the database, it puts a low ceiling on 
performance. 




On Wednesday, November 4, 2015 at 8:54:01 AM UTC-8, spdegabrielle wrote:
> I'd prefer to do it in memory.
> Writing to disk just to read it straight back seems like a lot of effort, and 
> I lose the ability to make pages that are updated on-the-fly.
> 
> I'll have a look at the source for the pollen and scribble renderers to see 
> if I can separate reading a file from transforming markup.
> 
> Thanks again
> 
> Stephen
> 
> 
> On Wed, 4 Nov 2015 at 15:42, Matthew Butterick <chro...@gmail.com> wrote:
> I haven't spent much time thinking about database / live web server 
> integration. Pollen (and Greg Hendershott's Frog, which also supports 
> Scribble syntax) are built around a static model. Of course, you could 
> retrieve source from your database, write it to a temp file, and render that 
> path.
> 
> 
> 
> 
> 
> 
> 
> On Wednesday, November 4, 2015 at 3:44:33 AM UTC-8, spdegabrielle wrote:
> 
> > Thanks Matthew,
> 
> >
> 
> > I have two question that I didn't express clearly:
> 
> > 1. A renderer that would create xexpr's for direct consumption of the 
> > racket web server. It sounds like pollen will be perfect! (I quickly 
> > dismissed writing my own wiki-markup renderer on the basis that scribble 
> > already existed)
> 
> > 2. A renderer that would accept a string rather than a path. Both the 
> > scribble and pollen renderers seem to require a path to a file, but I'm 
> > keen to store pages in a database[1].
> 
> >
> 
> > I think you have solved (1) thanks! - do you have any suggestions for (2)?
> 
> >
> 
> > I have another concern that I haven't thought through...can I (should I) 
> > enable users to enter executable code - I quite like the idea though it 
> > obviously holds risks :)
> 
> >
> 
> > Kind regards,
> 
> >
> 
> > Stephen
> 
> >
> 
> >
> 
> >  [1] as an alternative I could just store my wiki pages as text files in a 
> >git repository and get history for free but I wanted to keep it simple.
> 
> >
> 
> >
> 
> > On Wed, 4 Nov 2015 at 02:27, Matthew Butterick <chro...@gmail.com> wrote:
> 
> > I found this task challenging too, so I made a Scribble-derived DSL that's 
> > natively oriented toward making X-expressions, for instance:
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > #lang pollen/markup
> 
> >
> 
> >
> 
> >
> 
> > ◊title{Bottles --- ◊italic{Abridged}}
> 
> >
> 
> >
> 
> >
> 
> > ◊(apply itemlist
> 
> >
> 
> >   (for/list ([n (in-range 100 0 -1)])
> 
> >
> 
> >     ◊item{◊(format "~a" n) bottles.}))
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> >
> 
> > On Tuesday, November 3, 2015 at 4:08:01 PM UTC-8, spdegabrielle wrote:
> 
> >
> 
> > > Hi,
> 
> >
> 
> > >
> 
> >
> 
> > > is there a way to to generate xexprs for consumption of the web server
> 
> >
> 
> > >
> 
> >
> 
> > > I thought making a simple wiki with scribble as the syntax might be fun, 
> > > but I'm tripping at this first hurdle  i.e. (scribblestring->xexpr 
> > > a-string) ->xexpr
> 
> >
> 
> > >
> 
> >
> 
> > > Any suggestions appreciated
> 
> >
> 
> > >
> 
> >
> 
> > > Stephen
> 
> >
> 
> > >
> 
> >
> 
> > >
> 
> >
> 
> > > #lang racket
> 
> >
> 
> > > (require scribble/decode)
> 
> >
> 
> > > (require scribble/render)
> 
> >
> 
> > > ;(require scribble/html-render)
> 
> >
> 
> > > ;(require scribble/text-render)
> 
> >
> 
> > > (require scribble/markdown-render)
> 
> >
> 
> > >
> 
> >
> 
> > > (define a
> 
> >
> 
> > >   "@title{Bottles --- @italic{Abridged}}
> 
> >
> 
> > > @(apply itemlist
> 
> >
> 
> > >   (for/list ([n (in-range 100 0 -1)])
> 
> >
> 
> > >     @item{@(format \"~a\" n) bottles.}))")
> 
> >
> 
> > > a
> 
> >
> 
> > >
> 
> >
> 
> > > (render (list (decode (decode-string a))) (list 
> > > "/Users/spdegarielle/Desktop/")       #:render-mixin render-mixin )
> 
> >
> 
> >
> 
> >
> 
> > --
> 
> >
> 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> 
> >
> 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users...@googlegroups.com.
> 
> >
> 
> > For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> --
> 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users...@googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to