Code Monkey home page Code Monkey logo

effigy's People

Contributors

jferris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

effigy's Issues

Default implementation of Effigy creates invalid HTML5 markup

Effigy views create their output using the "output" method, which defaults to using Nokgiri's "to_xhtml" method. This method appends "xmlns" info to the root tag, regardless of whether the HTML document actually has an XHTML doctype. This issue can be resolved by overiding "output" and calling current_context.to_html instead.

It might be helpful for docs to be updated to reflect this use case.

Separates the project in two: effigy and effigy-rails

I see which the most issues point to Rails. My idea is separates the project. The first will be the source base and the main goal is be free of the frameworks. So, others developers can design extensions exclusively for others fameworks, for example Sinatra.

The second will be effigy-rails, of course!

Thanks.

sinatra layouts

Perhaps best in sinatra-effigy. What's the call on framework extensions existing inside or outside of Effigy? Saw another ticket about that.

HTML tags being stripped

I just switched from 0.3.2 to 0.4, and since switch, several of the start tags of my HTML 5 documents are being stripped. The tags being stripped seem to include everything up to the opening <title> tag - the title text itself, the closing tag, and everything else in the doc is being returned.

rails integration

Wouldn't it make sense to assume that everything that is in your index.html.effigy is evaluated in the transform method anyways and drop a few lines of code?

Request: insert() method

Hey

There might be an existing way to do this in effigy already, I'm not sure, but I've gone ahead and implemented an insert() method for adding child nodes to a parent node. For example, you can dynamically add li elements to a ul list. A list of attributes for your element can be added as well, through a Hash.

You can see an implementation I've made here:
http://github.com/robgleeson/effigy/commit/a02aeaa23b890958d6719c7db4c098f777ec3c35

It needs documented and I'm not sure if you want to add something like this but I thought I'd throw it out there. I've found it very useful in some of my own projects but there might be an existing way already .. I just couldn't find anything.

Best,
Rob

Effigy::Rails::View only processes one element

At least in Rails, Effigy expects all the HTML to be contained in one parent element. This is fine for non-Rails work where the whole document is contained in an <html> element, but in Rails, the file may be wrapped in a layout, so there's no expectation that it will contain one root element. I can work around this by making sure each Effigy template is wrapped in a <div>, but that's a little silly.

Mysterious problem

I'm with a little issue here. Every time I try to access an HTML tag identified with class or id in my template, Effigy returns me a 'No element matched the given selector' error.

For example, I have a simple template with <div class="page">, and in my view I look for it with find('div.page').replace_each(@pages)..., and I always get this error.

I don't know what I'm doing wrong. I've already tested on others computers and other examples, and the problem persists.

Any suggestions?

Option to bring back HTML with no DOCTYPE

Right now, rendering with Effigy brings back the DOCTYPE, html, and body tags. My use case is on an Ajax call which just returns an HTML fragment that jQuery then replaces in the DOM. The extra tags around it messes up.

My current hack is:

def output
  current_context.to_html.sub(/.*<body>/, '').sub(/<\/body>.*/, '')
end

Rails: integrate with Haml

It would be really nice to be able to use Haml for template files. (Yes, I know it's an interpolation-based language, but the syntax is lots nicer than plain HTML.) The only Effigy+Haml solution I've seen is http://gist.github.com/261527, and I'm not sure how to generalize that to Rails.

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.