-
Notifications
You must be signed in to change notification settings - Fork 126
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
Rendering HTML directly #26
Comments
Target seems reasonable to me. /cc @tbranyen @sindresorhus thoughts? |
Sure, I would probably go with |
Good point, overloading the |
Perhaps |
How many other types are there? It's not really HTML you're rendering, it's text. I'd say this is a precompile vs. render flag. |
|
The only reason I was thinking |
But JS and Coffee in this case represent means to the same end, once the coffee is converted to JS they are both precompiled templates, while what you're requesting sits outside of that as completely rendered templates. These feel distinct enough to be treated separately. Maybe: // Precompile to JS.
precompile: {} // or true
// Precompile with options.
precompile: {
coffeescript: true
}
// Render to text (default to html extension).
render: {} // or true
// Rendering with options.
render: {
ext: "html"
} This isn't really standard for Grunt, but maybe something along these lines. I could foresee wanting both precompiled and rendered. |
True but in order to properly compile coffee-script and remove as much bloat (all of the duplicate helpers from it, etc.) you need to intelligently concatenate all of your coffee-script before compiling. Not that I do this yet. However as coffee-script provides no way to remove these helpers on a per-file basis this kind of thing will eventually be required as some quick testing on my end shows a 15% reduction in final output size between compiling ~50 coffee then merging or merging then compiling 1 coffee. But that's also not really related to this. I just brought it up as I want the config syntax between this and grunt-haml to be the same-ish. With that said I'd probably prefer a precompile flag like the following (that way I could extend it in grunt-haml to achieve the coffee thing): // Precompile
precompile: true // default
precompile: false // render the html
precompile: {
output: 'js' // default
}
precompile: {
output: 'coffee'
}
precompile: {
output: 'livescript'
} On a completely unrelated note... has any thought about doing |
There have been several attempts (some by me) to smash every templating engine into the same round hole, but it always winds up being a monolithic mess of configuration options to support each templating engine's unique features. That said, taking the output of a precompiled template and wrapping it with an AMD define call, or assigning it to a JST namespace could definitely be generalized into grunt-lib-contrib. I'd love to see something like that. |
👍 |
there is some work being done on gruntjs/grunt-contrib-pug#19 that could give us a coherent standard for implementing this sort of thing across all of our templating tasks. |
👍 +1 for this option |
What ended up happening with this? |
👍 +1 |
Any news about this? 😕 |
+1 |
1 similar comment
+1 |
It would be nice to create static sites, +1 |
Any news? |
+1 |
Hello everybody! |
+1 |
I'd like to add support for
grunt-contrib-handlebars
to allow it to render handlebars templates directly to HTML.Thoughts on option names ?
Something like the above.. unless you have a better idea for the
target
name.The text was updated successfully, but these errors were encountered: