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

Provide template documentation to developers #23

Open
asmith-mdsol opened this issue Nov 27, 2012 · 4 comments
Open

Provide template documentation to developers #23

asmith-mdsol opened this issue Nov 27, 2012 · 4 comments

Comments

@asmith-mdsol
Copy link
Contributor

Developers will want to learn what configuration options are available. We should have a config:help task that does this. It may be as simple as dumping the templates to screen.

More complicated options might execute the template with a special configured object that records all the calls made to it, so that we can output a terse report of all the environment variables used. We might want to output the default values too but we'd have to change default handling from <%= configured.my_var || 'my default' %> to <%= configured.my_var.with_default('my default') %>.

@asmith-mdsol
Copy link
Contributor Author

My suggestion above to spy on usage of configured only works (naively) if the template is logic-free. We could perhaps permute all requested configuration values against nil and non-nil. Not sure I like the thought of the combinatorial explosion this might lead to.

@asmith-mdsol
Copy link
Contributor Author

Alternatively, perhaps we should use logic-free templates like mustache and add "view" objects for any sophisticated logic. Not sure how keen I am to add this as an extra dependency.

@fosdev
Copy link

fosdev commented Dec 20, 2012

@asmith-mdsol Why are we taking the approach to doing custom templates of having an application build a class for this vs. use a canonical folder in the application root (e.g. lib/templates) that the existing rake task can pickup up erb templates there when you generate all, etc. Or am I misunderstanding implementing custom templates?

@jcarres-mdsol
Copy link
Contributor

I think we write/read the templates in config/ because they are configuration, I would not expect them in lib/
even in config/templates I would expect something different.

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

3 participants