evanmoran / oj

Unified web templating for the people. Thirsty people.
MIT License
445 stars 7 forks source link

svg #13

Closed spencermountain closed 10 years ago

spencermountain commented 10 years ago

hey evan, sorry if this is already somewhere, what would you recommend for including svg in oj syntax? there's like a billion types of elements in that spec.. should i make a plugin? or is there a way to do something like:

div ->
  svg ->
    path {d:"M0,0L9,7L18,0"}
evanmoran commented 10 years ago

Yes, all tags are included in oj as functions, so you should be able to use them just like that! Let me know if you hVe trouble.

spencermountain commented 10 years ago

thanks evan, sorry if this is a bother. in general is there a way to place random xml inline with oj markup? sometimes you get html from an api, or get a random chunk of svg, and I am having to handle them seperately is there be a way of working it in, something like this?

 div ->
   oj.to_oj('<a href="">hi</a>')

your library has changed how I program. It is amazing cheers

evanmoran commented 10 years ago

I take it back. Now that I look into it you can put html in any tag function:

div('<a href="ojjs.org">the link will work!</a>')