First, let me say I'm loving this project. However, I'm finding it hard to get help creating a custom tag. The docs are a little light as are the tests. Generally speaking, I think many people would benefit from more docs and tests.
My specific need right now is creating a custom tag that would render a random element. So, my template would be:
`
{{#Random}}
{{#Voice}}
Phrase one
{{/Voice}}
{{#Voice}}
Phrase two
{{/Voice}}
{{/Random}}
`
As you can see, I'm creating html, more specifically ssml for an Alexa skill.
I've found examples of FirstOf that takes the first element of a collection of strings. But I don't want my tag to be collection-type aware; it should render one of its child elements allowing me to use whatever nested-structure I choose.
First, let me say I'm loving this project. However, I'm finding it hard to get help creating a custom tag. The docs are a little light as are the tests. Generally speaking, I think many people would benefit from more docs and tests.
My specific need right now is creating a custom tag that would render a random element. So, my template would be:
`
{{#Random}} {{#Voice}} Phrase one {{/Voice}} {{#Voice}} Phrase two {{/Voice}} {{/Random}}`
As you can see, I'm creating html, more specifically ssml for an Alexa skill.
I've found examples of FirstOf that takes the first element of a collection of strings. But I don't want my tag to be collection-type aware; it should render one of its child elements allowing me to use whatever nested-structure I choose.
Any help much appreciated