diff options
author | Pieter van de Bruggen <pvande@gmail.com> | 2010-11-07 23:18:00 -0800 |
---|---|---|
committer | Pieter van de Bruggen <pvande@gmail.com> | 2010-11-07 23:18:00 -0800 |
commit | 367419d874530116dd2e824cefffa175644308ba (patch) | |
tree | 92337403fb5c18f1df048145bfdd430c11b1656f | |
parent | b007b66d655a4b3b30fa2964c50369f089c558b7 (diff) | |
download | mustache-spec-367419d874530116dd2e824cefffa175644308ba.tar.gz |
Outlining optional modules.
-rw-r--r-- | README.md | 27 | ||||
-rw-r--r-- | TESTING.md | 11 | ||||
-rw-r--r-- | specs/~lambdas.yml (renamed from specs/lambdas.yml) | 0 |
3 files changed, 32 insertions, 6 deletions
@@ -6,4 +6,29 @@ support any draft prior to v1.0.0.* As implementers work to build their own parsers, testing scripts may be contributed to the 'scripts' directory, and code snippets (e.g. for lambdas) -may be provided as well (location TBD). +may be provided as well. + +Optional Modules +---------------- + +Specification files beginning with a tilde (~) describe optional modules. At +present, the only module being described as optional is regarding support for +lambdas. As a guideline, a module may be a candidate for optionality when: + + * It does not affect the core syntax of the language. + * It does not significantly affect the output of rendered templates. + * It concerns implementation language features or data types that are not + common to or core in every targeted language. + * The lack of support by an implementation does not diminish the usage of + Mustache in the target language. + +As an example, the lambda module is primarily concerned with the handling of a +particular data type (code). This is a type of data that may be difficult to +support in some languages, and users of those languages will not see the lack +as an 'inconsistency' between implementations. + +Support for specific pragmas or syntax extensions, however, are best managed +outside this core specification, as adjunct specifications. + +Implementors are strongly encouraged to support any and all modules they are +reasonably capable of supporting. @@ -11,9 +11,12 @@ In general, the process for each `.yml` file is as follows: 1. Ensure that each element of the 'partials' hash (if it exists) is stored in a place where the interpreter will look for it. - 2. If your implementation supports lambdas, ensure that each member of 'data' - tagged with '!code' is properly processed into a language-specific - lambda reference. + 2. If your implementation will not support lambdas, feel free to skip over + the optional '~lambdas.yml' file. + + 2.1. If your implementation will support lambdas, ensure that each member of + 'data' tagged with '!code' is properly processed into a language- + specific lambda reference. * e.g. Given this YAML data hash: @@ -27,8 +30,6 @@ In general, the process for each `.yml` file is as follows: * If your implementation language does not currently have lambda examples in the spec, feel free to implement them and send a pull request. - * If your implementation does not support lambdas, feel free to skip - over the `lambdas.yml` file. 3. Render the template (stored in the 'template' key) with the given 'data' hash. diff --git a/specs/lambdas.yml b/specs/~lambdas.yml index 692b41b..692b41b 100644 --- a/specs/lambdas.yml +++ b/specs/~lambdas.yml |