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

Dependencies between templates #31

Open
domenkozar opened this issue Jan 23, 2013 · 3 comments
Open

Dependencies between templates #31

domenkozar opened this issue Jan 23, 2013 · 3 comments

Comments

@domenkozar
Copy link
Member

Goals:

  • Ability to use multiple templates at the same time and depend on them (similar to Templer structures, but uses templates as structures you can depend on)
  • Ability to have logic that decides what files get rendered

Implementation:

  • variables and defaults are passed to all templates and all questions are collected from the dependency templates
  • issue Configurator for each template given global settings
  • keep ordered Configurator.dependencies list of templates
  • provide include/exclude options for files
  • pre/post hooks for executing dependencies
  • document local commands can be used as simple as just commands inside a project
  • test for multi inheritance
  • specify [templates] section something like::
    [template]
    dependency.foobar.template = bobtemplates.foobar/
    dependency.foobar.destination = foobar/
    dependency.foobar.include = **
    dependency.foobar.pre_render_dependency = ....
    dependency.foobar.post_render_dependency = ....
    dependency.licenses.template = bobtemplates.licenses
    dependency.licenses.destination = .
@domenkozar
Copy link
Member Author

This is a blocker for 0.1 release.

@domenkozar
Copy link
Member Author

There is also an use case to reuse existing mr.bob template and change only a few things: for example add some questions, etc.

Example for PasteScript:

class FreeBsdTemplate(HostBsdBaseTemplate):
    """."""
    _template_dir = 'tmpl/BSD/FreeBSD'
    defaults = getdefaults('FreeBSD')
    summary = "A FreeBSD doc template."

    vars = HostBsdBaseTemplate.vars + \

@djowett
Copy link

djowett commented Feb 16, 2015

I think that this risks making templates horrible to maintain. You would have problems like the main template not be able to change because other templates depended on it's variables, then if you did change variables, you would need version pins between templates.

I might not be thinking the above through thoroughly, but mrbob is nice principally because it's simple - IMO this goes the way of paster/zopeskel making it too complex to maintain beyond a few experts, for not much benefit. Am I wrong?

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

2 participants