Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Finding WO people for startups (cult of the dead)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding WO people for startups (cult of the dead)



As a matter of fact, it's based on DOM classes and ids. 

For example, you can fill a paragraph with content like this in your code:

(html/deftemplate index "tutorial/template1.html"
  [ctxt]
  [:p#message] (html/content (:message ctxt)))
deftemplate is a macro that creates a template called "index". It creates a function that is applied when the matching route is called (this is defined in conjunction with another library, Ring, which is inspired by Ruby's Sinatra). It loads the file "tutorial/template1.html", and matches each "p" tag with the id "message". Finally, a function is applied that fills the paragraph with the content from the ctxt parameter with the key :message (the colon marks a symbol, just like Ruby).

I have copied this from a tutorial. If you want to know more, check it out:
https://github.com/swannodette/enlive-tutorial


On 29.09.2011, at 19:00, Chuck Hill wrote:


On 2011-09-29, at 1:01 AM, Marius Soutier wrote:

The Clojure Enlive library allows you to create code-free static HTML and replace the contents from Clojure dynamically by applying functions to CSS-like selectors. I think I like that approach best so far.

That sounds like an interesting approach.  Can you post a small example?  Does the code need to changed if signifiant change are made to the layout or can you use things like the HTML ID?


Chuck


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects








 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Finding WO people for startups (cult of the dead) (From: email@hidden)
 >Re: Finding WO people for startups (cult of the dead) (From: Chuck Hill <email@hidden>)
 >Re: Finding WO people for startups (cult of the dead) (From: email@hidden)
 >Re: Finding WO people for startups (cult of the dead) (From: Chuck Hill <email@hidden>)
 >Re: Finding WO people for startups (cult of the dead) (From: Simon <email@hidden>)
 >Re: Finding WO people for startups (cult of the dead) (From: Marius Soutier <email@hidden>)
 >Re: Finding WO people for startups (cult of the dead) (From: Chuck Hill <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.