-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Plugin/extension system #59
Comments
You mention Danny's secret key plugin, but it appears the plugin itself is a secret? :-) I'd love to see it - secret key generation (and other similar extensions) would be quite nice. |
Is anyone opposed to setuptools entry points for handling this? I'm going to assume the most natural place to something like this is for users to write their own Jinja2 Extensions so the custom tags can be used in their templating. At first glance it doesn't seem too difficult to implement, I'd be happy to give it a go. Would pretty much just need to load everything in The other problem is Jinja Extensions are not exactly straight forward if you haven't done them before. Maybe start off with just simple Jinja Extenions, and then slowly over time add some CC helpers to make authoring them a little more straight forward in common cases? |
See Pull Request #103 |
I have somewhat run into a need for this as I have a template with some repeated, complicated Jinja templating that I don't want to make into one explicit Jinja plugin that people have to depend on so as to not gain a dependency on my template. It would be great if from some hook I could directly manipulate the Jinja context to inject my own items and plugins. |
Hi @brettcannon! 👋 Would your "own items and plugins" have any dependencies (other than what is already required by cookiecutter itself)? |
Nope. Honestly I just want a way to add more items programmatically after the user has entered their info. To put this in concrete terms, I'm doing |
Okay, cool. 🙇 I've used jinja2 assignments to help with that, but as you say, it doesn't work across multiple files. Thanks for the feedback, I'll take it into consideration when we design a plugin system. |
I think this falls under the same category as #848. Assigning the Requires Sponsorship label until we have sponsorship for this project. |
implement a templates directory so a maintainer can use `extends`, `includes`, `blocks`, `import` and `super` inside the cookiecutter project template using jinja directly. docs: https://jinja.palletsprojects.com/en/2.11.x/templates/#template-inheritance closes: cookiecutter#1484 ref: cookiecutter#706 ref: cookiecutter#59 ref: cookiecutter#1004
implement a templates directory so a maintainer can use `extends`, `includes`, `blocks`, `import` and `super` inside the cookiecutter project template using jinja directly. docs: https://jinja.palletsprojects.com/en/2.11.x/templates/#template-inheritance closes: cookiecutter#1484 ref: cookiecutter#706 ref: cookiecutter#59 ref: cookiecutter#1004
implement a templates directory so a maintainer can use `extends`, `includes`, `blocks`, `import` and `super` inside the cookiecutter project template using jinja directly. docs: https://jinja.palletsprojects.com/en/2.11.x/templates/#template-inheritance closes: cookiecutter#1484 ref: cookiecutter#706 ref: cookiecutter#59 ref: cookiecutter#1004
implement a templates directory so a maintainer can use `extends`, `includes`, `blocks`, `import` and `super` inside the cookiecutter project template using jinja directly. docs: https://jinja.palletsprojects.com/en/2.11.x/templates/#template-inheritance closes: cookiecutter#1484 ref: cookiecutter#706 ref: cookiecutter#59 ref: cookiecutter#1004
Make it possible to implement Cookiecutter plugins like:
This issue is dependent on #29 / #48.
I wonder if there would be a way to implement the plugin system such that #55 would be possible as a plugin. Not sure.
The text was updated successfully, but these errors were encountered: