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

simplify logic for resolving ext and engine #15

Open
jonschlinkert opened this issue Mar 2, 2015 · 0 comments
Open

simplify logic for resolving ext and engine #15

jonschlinkert opened this issue Mar 2, 2015 · 0 comments

Comments

@jonschlinkert
Copy link
Owner

we need cleaner logic for auto-detecting the engine to use.

Hmm, maybe it's as simple as this:

  • use the built-in default - engine-lodash - when no engine is defined by the user.
  • if template.option('view engine', 'foo') is defined, use that as the default.
  • use a .pickEngine() method to resolve the engine based on engine options, template params, etc.
  • expose .pickEngine() on the options so it can be overridden by implementors/users.
template.option('pickEngine', function(env) {
  // env can be an object with template, options, locals, method details
  // do stuff and return an engine name
});

Exposing the option to use a custom .pickEngine() function allows us to implement simpler, more opinionated logic.

thoughts @doowb?

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

No branches or pull requests

1 participant