-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add ability to use custom delimiters #91
Add ability to use custom delimiters #91
Conversation
f9c97b5
to
d8875b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to think a way to handle the comments also. We can bump the version for 3.0 and change the way comments work, per example an "*" after the delimiter would start a comment.
d8875b8
to
2c149d7
Compare
For now, I'd stay away from a) making comment delimiters dependent upon the delimiter that's used and b) from bumping to v3 unnecessarily. The use case is to use Jet templates on the server in concert with Mustache-style template languages on the client side. Vanilla Mustache uses If and when we go ahead with #93, #84 and #32 we can talk about it again because for these I really do want to bump the major. |
This also adds these consts to the lexer struct when calling the constructor.
In order to be able to set custom delimiters it's necessary to explicitly tell it to start the lexing process. This change is backwards compatible, albeit it's also internal because the lexer isn't exported.
This includes unit tests – the same ones that were already there, just with different delimiters.
This includes an integration test.
2c149d7
to
4e11fa6
Compare
I think this has reasonable coverage and will not break anything. I'll rework the Wiki slightly (it only mentions the |
I updated the wiki: https://github.com/CloudyKit/jet/wiki/3.-Jet-template-syntax#delimiters |
This fixes #68 and introduces the ability to use custom delimiters.
Use like this:
TODO:
This fixes #68 and closes #98.