Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it JST compliant #4

Closed
dnagir opened this issue Nov 16, 2011 · 3 comments
Closed

Make it JST compliant #4

dnagir opened this issue Nov 16, 2011 · 3 comments

Comments

@dnagir
Copy link

dnagir commented Nov 16, 2011

Currently it generates the full JST template trying to shorten the names.
I did similar thing in my pakunok gem for hamljs. Did it even smarter when ot was producing the plain function names for subdirectories.

But after some discussions and considerations decided to stick to rails conventions
This resulted in a separate gem (ruby-haml-js).

It might look like a good idea to automatically attach the template to JST.
But this is not how it is supposed to be.

@netzpirat
Copy link
Collaborator

I do nothing fancy with the path, I just use scope.logical_path and pass it to the haml-coffee compiler. So it's up to the user how he configures the asset pipeline to get the name he needs.

JST template generation was already built into haml-coffee and I didn't want to change it.

@netzpirat
Copy link
Collaborator

There are two solutions for this:

  1. Remove the JST generation from haml-coffee in haml_coffee_assets with simple string manipulation. I don't like it, because why should haml_coffee_assets remove a completely valid JST template just to let the Sprocket JST processor generate the exact same template again?
  2. Add a parameter --no-template to skip the template generation in haml-coffee and change haml_coffee_assets to pass it to the compiler and update the README that .jst is needed as extension.

I don't want to spend more time to make something that works fine for me now to make it work a little different just to be "JST compliant".

If you bother with the missing .jst in your extension, I'll happily merge any pull request that solves it in the way described as the 2nd solution above.

@netzpirat
Copy link
Collaborator

The Express support in Haml Coffee 0.5 enables Haml Coffee Assets 0.5 to easily support the Sprockets JST processor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants