Giter Club home page Giter Club logo

Comments (10)

ckirkendall avatar ckirkendall commented on July 28, 2024

I do plan on supporting enlive syntax but it is still a bit off. There is however hope. I have been working on parser for css3 selectors that would allow me to convert string selectors to enlive selectors. This is required for a compile time snippet feature I am adding in enfocus. It would also allow me to write wrappers for enlives' deftemplate and defsnippet and provide string base selectors for these.

from enfocus.

robert-stuttaford avatar robert-stuttaford commented on July 28, 2024

Ok, so right now, you're also duplicating defsnippet and deftemplate code when you need them on both ends?

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

For my sites I am not using enlive, all rendering is happening on the
client side. So, I have not ran across this issue. That being said I can
certainly see the need for this. I may have something late next week for
you play with. It depends on how much time I get to work on things this
week.

CK

from enfocus.

robert-stuttaford avatar robert-stuttaford commented on July 28, 2024

Awesome :-)

Thank you once again for your work on producing a port of a great library. The domina branch looks interesting!

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

Quick question on having shared source between enlive and enfocus
templates. While I can make the two look the same namespacing issues would
still keep them from being shared. The two sets of macros
generated different code so using them interchangeably would be difficult
unless you could swap out the namespace on the cljs compilation.

On Mon, Jul 23, 2012 at 9:57 AM, Creighton Kirkendall <[email protected]

wrote:

For my sites I am not using enlive, all rendering is happening on the
client side. So, I have not ran across this issue. That being said I can
certainly see the need for this. I may have something late next week for
you play with. It depends on how much time I get to work on things this
week.

CK

from enfocus.

robert-stuttaford avatar robert-stuttaford commented on July 28, 2024

Yes, I know.

I'm using cljsbuild's 'crossover' feature to add .cljs files from specific .clj namespaces. I'm pretty sure I can jimmy in some additional transformations to the code when this copying happens. Changing the namespace is, of course, trivial to do in this instance. And it's well worth the upfront investment!

Also, there are other options such as CLJX: https://github.com/lynaghk/cljx.

Shared templates can be incredibly handy... one example from our own wishlist: a websocket implementation where you have passive read-only clients receiving html from the server (using the server templates) as other read-write clients produce content (using client templates) and pushing just the data up.

For me, right now, it's all about being able to use the REPL in Emacs and midje/midje-mode :-)

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

Nice! I had not seem cljx.

CK

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

I took a slightly different route on this and decided to implement the enlive syntax first. I added support for basic enlive selectors. It does not support selector groups yet but supports almost all the enlive selector functions. Only one is not supported "has" because it isn't in the css selector spec.

To use pull and build from the domina-migration branch and add the following to your namespace declaration.

(:use [enfocus.enlive.syntax :only [attr= attr-starts attr-ends attr-contains ...]])

Hope this helps let me know if you run into any trouble I have not tested this as much as I would like yet.

from enfocus.

ckirkendall avatar ckirkendall commented on July 28, 2024

@robert-stuttaford were you able to test out the enlive syntax support I added?

from enfocus.

robert-stuttaford avatar robert-stuttaford commented on July 28, 2024

I was able to convert all my selector code to :symbols instead of "strings". All of my selectors are simple; tag or #id or .class. I didn't need to use enfocus.enlive.syntax at all.

It works 100%!

Thanks for this. It'll make using these templates with enlive that little bit easier. Of course, I'll still need to split out the defsnippet/deftemplate code from the defaction code, and make sure I'm not including any em/listen calls in my templates :-)

from enfocus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.