collective / mr.bob

Mister Bob (the builder) is filesystem template renderer
http://mrbob.readthedocs.org/en/latest/
Other
69 stars 30 forks source link

add +__if_render.me__+ statement for conditional rendering #29 enhancement "Conditionally render files based on answer. #55

Closed jpcw closed 10 years ago

jpcw commented 11 years ago

Variables can also influence rendering. Surround variables with plus signs. For example foo/+__if_render.me__++author+/+age+.bob given variables author being Foo and age being 12, foo/Foo/12 will be rendered if render.me is True.

Else only foo/ will be rendered. Please notice that only ('y', 'yes', 'true', 'True', 1) are True, anything else will be considred as False.

it's a proposition for #29 enhancement "Conditionally render files based on answer.

I added tests and of course coverage is 100%. Documentation must also be reviewed, for a more clear comprehension.

domenkozar commented 10 years ago

Thanks for this pull request!

Could you split it into small contributions:

I'm not sure I like the implicit way how files can be rendered. The idea was to add exclude variable that you could hook into post rendering step and based on answers supply what files would get skipped. Your contribution makes it more convenient though. Will think about it.

jpcw commented 10 years ago

ok

We could close this PR