Skip to content

Allow the content type to be passed into the js/javascript script tag.#14

Merged
noirbizarre merged 1 commit intonoirbizarre:masterfrom
SoftwareMaven:coffeescript
Apr 25, 2013
Merged

Allow the content type to be passed into the js/javascript script tag.#14
noirbizarre merged 1 commit intonoirbizarre:masterfrom
SoftwareMaven:coffeescript

Conversation

@SoftwareMaven
Copy link

No description provided.

@noirbizarre
Copy link
Owner

As the point with theses template tags is to write less code, Instead of manually specifying the content type for coffee script why not add a coffeescript helper.

I suggest to keep your modification (it allows for unsupported content types) and add both coffee and coffeescript helpers so you can write:

{% js "js/my.coffee" type="text/coffeescript" %}
{% coffeescript "js/my.coffee" %}
{% coffee "js/my.coffee" %}

I'll merge it ASAP before making a new release.

@SoftwareMaven
Copy link
Author

I like that idea. I didn't do it because of the profusion of languages like
coffeescript, clojurescript, brython, hotruby, etc (see
https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS,
not all of which can be compiled in the browser), so I thought a more
generic solution might be better.

Coffeescript does seem to have the most mindshare right now, so
special-casing it it probably worthwhile.

tj

On Sun, Apr 7, 2013 at 11:00 AM, Axel Haustant notifications@github.comwrote:

As the point with theses template tags is to write less code, Instead of
manually specifying the content type for coffee script why not add a
coffeescript helper.

I suggest to keep your modification (it allows for unsupported content
types) and add both coffee and coffeescript helpers so you can write:

{% js "js/my.coffee" type="text/coffeescript" %}
{% coffeescript "js/my.coffee" %}
{% coffee "js/my.coffee" %}

I'll merge it ASAP before making a new release.


Reply to this email directly or view it on GitHubhttps://github.com//pull/14#issuecomment-16018696
.

Travis Jensen


*Read the Software Maven @ http://softwaremaven.innerbrane.com/
Read my LinkedIn profile @ http://www.linkedin.com/in/travisjensen
Read my Twitter mumblings @ http://twitter.com/SoftwareMaven
Send me email @ travis.jensen@gmail.com

What kind of guy calls himself the Software Maven???

@noirbizarre
Copy link
Owner

I agree, coffeescript is more widely used than other alternatives and it might need a special treatment :)

noirbizarre added a commit that referenced this pull request Apr 25, 2013
Allow the content type to be passed into the js/javascript script tag.
@noirbizarre noirbizarre merged commit 23d5b44 into noirbizarre:master Apr 25, 2013
@noirbizarre
Copy link
Owner

I'll add the coffeescript template tag myself because I need to release.

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

Successfully merging this pull request may close these issues.

2 participants