Skip to content

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

Closed
jpcw wants to merge 9 commits intocollective:masterfrom
jpcw:master
Closed

add +__if_render.me__+ statement for conditional rendering #29 enhancement "Conditionally render files based on answer.#55
jpcw wants to merge 9 commits intocollective:masterfrom
jpcw:master

Conversation

@jpcw
Copy link
Copy Markdown
Member

@jpcw jpcw commented Nov 5, 2013

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
Copy link
Copy Markdown
Member

Thanks for this pull request!

Could you split it into small contributions:

  • add bobtemplates.starter
  • rename exceptions to bobexceptions
  • add +if+ for more flexible rendering

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
Copy link
Copy Markdown
Member Author

jpcw commented Nov 21, 2013

@jpcw jpcw closed this Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants