-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Creating jinja2 templates from example files which have static values #25
Comments
I have done some similar thing: write change log in yml and get them into changelog.rst. You can check if it is related to your thinking. Reference: https://github.com/moremoban/moban/blob/master/mobanfile#L11 |
moremoban/pypi-mobans#21 (comment) is more what I mean --- sometimes an upstream example file, or a upstream template, has some literal text which needs to be removed or replaced. This is a |
this is reverse the direction of moban. What moban does is take a template and a data dict and produce templated output. now, the reverse is: take a templated file and apply some "magic" then produce the template, which can be used in forward direction. I wondered how to generalize the "magic". When I did CHANGELOG.rst -> changelog.yml + changelog.rst.jj2, the "magic" is specific to CHANGELOG.rst in my style. |
Only magic I can think of is allowing a list of regex transforms for each target. While it would be more common to use with |
This could be done as a template engine, which looks for configuration values and replaces them with the configuration keys. |
Sort of the complement of https://github.com/econandrew/untemplate/blob/master/README.md |
An idea I had was wanted to have some templates which are jinja-ified versions of example files.
The best way to explain it is with a real case.
https://github.com/ogrisel/python-appveyor-demo is an example repo that I have helped build.
While I could possibly moban-ise it, I am not sure the main maintainer would agree, as that repo is supposed to look easy, and moban looks complicated ;-)
I can use the new
copy:
to obtain the two files in https://github.com/ogrisel/python-appveyor-demo/tree/master/appveyorHowever I want a jinja-ified version of https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
I could manually build the jinja version, but I would prefer the template to be automatically maintained whenever the source file is updated.
Essentially, I need to go backwards. file -> template
One way to achieve this is for files to be generated from jinja2 global functions, ala #23
The text was updated successfully, but these errors were encountered: