Some suggestions for clarification of advanced examples. #13

Open
wants to merge 1 commit into
from

Projects

None yet

2 participants

@pdaoust

Hi there. I changed the explanation of a couple of the advanced examples -- just two things I didn't quite understand at first, and thought could be clarified.

After trying unsuccessfully to use def.loadfile() to bring in a partial, I did a search of the source and found it was meant as an example of how to augment def, so I thought it might be good to indicate that loadfile() isn't a built-in function.

Ummm, what else... I added a description of the two runtime conditionals at the end, and added an example of a loop.

@kgcab

loadfile() would have to be accessible in the local context. It would not be found in the def associative array. doT strips off the 'def.' in definition directives before evaluating the remainder (assuming a matching string is not found in the def aa - in which case the directive is ignored - there's no way to change a value once it is set in the def aa).

Seems like most of the examples, excepting withdoT.js, are missing some setup to make them work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment