-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Defect or User Error? No output for Dynamic Names #305
Comments
This was optional for the specification, and no one has ever asked me for it before. It probably isn't a huge burden to implement it, let me take a stab at it. For reference, this is the official "spec": https://github.com/mustache/spec/blob/master/specs/~dynamic-names.yml |
That would be great. I'll admit my use case requires a level of dynamism then what I would typically think mustache is suited for. However, mustache is easiest for me to execute on right now, and this feature is all that's missing to make this manageable. Thank you for the official spec. It perfectly sums up the solutions I am hoping to avoid. |
I have the change in a branch and will merge it shortly assuming no issues come up. |
It is merged but it would great for you to test it if possible or propose a test case in a PR - right now it is passing the spec tests. |
Thank you so much! Works just fine on my end. Submitting a simple test for now: Getting ready to start some pretty gnarly use cases next. If I find anything that does not work I will submit more tests. Thanks again! |
Closing. If there is a bug that you find please open a new more specific issue. Thanks for helping make mustache.java more complete. |
I've been using this feature pretty heavily and have not had any issues. Could I request a release of 0.9.14 into maven central? |
Sounds good. Will try and push it tomorrow.
…On Sat, Jul 6 2024 at 9:39 AM, Hamilton-dfp < ***@***.*** > wrote:
@spullara ( https://github.com/spullara )
I've been using this feature pretty heavily and have not had any issues.
Could I request a release of 0.9.14 into maven central?
—
Reply to this email directly, view it on GitHub (
#305 (comment)
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAAIFEDIKGRX7DJPDKIQKU3ZLAMUXAVCNFSM6AAAAABJ6YI2F6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJRHAYTKMJSGE
).
You are receiving this because you were mentioned. Message ID: <spullara/mustache
. java/issues/305/2211815121 @ github. com>
|
0.9.14 was released but might take a bit to distribute from sonatype. |
Confirmed that it is available. Thank you! |
Hi, the specification seems to have at least one typo regarding Dynamic Names, so I don't know if the problem I am facing is confusion about the specification, a defect in mustache.java, or if I am just plain wrong.
Code to Reproduce:
src/main/java:
src/main/resources:
pd-test.mustache:
dn.template:
dn.mustache:
Expected Output:
or
Depending on whether the named template should end in
.template
or.mustache
(Specification example says.template
, but that seems weird so I tried.mustache
just to be safe, see Additional Notes below).Actual Results:
Note that the dynamically named template is not loaded, regardless of extension.
Additional Notes
At a glance the specification suggests the proper syntax for dynamic names is {{>*name}}, however the actual wording says
Dynamic Names consists of an asterisk, followed by a dotted name
. This wording suggests that the greater than sign is not intended to be part of the syntax.When using
{{>*name}}
in mustache.java I get the following error:Note that this error is why I tried using
dn.mustache
in addition todn.template
, plus the fact that it feels weird that the specification would introduce a whole new extension just for this one use case.When I use
{{*name}}
as the wording of the specification suggests, mustache.java does not throw an error, but no content is included in the output.Thanks for taking a look!
The text was updated successfully, but these errors were encountered: