Hi John,

On 8/24/2015 4:31 PM, John Clements wrote:
> On Aug 24, 2015, at 12:35 PM, George Neuner <gneun...@comcast.net> wrote:
>
> I'm trying to generate some very simple web pages - basically success/failure 
status for URLs followed from an email.  However, I can't seem to figure out how to 
apply styles - other than predefined headings <h1>, etc. - to the document.

Can you explain in more detail what you mean by “styles”? It sounds like you 
want to take a plain-looking HTML page and change the way it looks—colors, 
fonts, etc.  If I’m right about this, then most of what you want will likely be 
accomplished by associating a CSS file with your page.

That's exactly what I want, but I would like to avoid having separate files associated with this. I would like to generate the HTML in Racket because I need to dynamically insert information into it. E.g.,

(send/back
    (response/xexpr
        `(html
            (body (list (p "Hello " (b ,username))
                        (p (style "color:red"  ; <- how to do this?
                            "An error occurred processing your request.))
     :


as in the web-server documentation  (sans the style clause).

There are examples of reading HTML from a string ... and I suppose I could do that ... but not of generating styled content directly.

There is a style struct and a style function in the HTML module, and it seems like many of the generating functions permit attributes to be attached to their document nodes, but there don't seem to be any examples, and I am unable to figure it out from the documentation (which seems quite cryptic in relation to most Racket documentation).

George

--
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