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
Custom tag support #41
Comments
Thanks for opening this ticket. I would love to support custom tags! I'm not sure either how we would support custom tags. Maybe one way is to allow the parser to include custom tags before it compiles? 🤔 Now I'm curious 😆 |
That’s how the other Elixir library handled it. At https://github.com/bettyblocks/liquid-elixir#custom-tags-and-filters, it’d either done via configuration or passing it in upon template compilation. It might have to be another argument or something passed into how This post https://blog.sverrirs.com/2016/04/custom-jekyll-tags.html has some ideas on ideas, based on Jekyll. Personally, giving the argument string as is to the tag would be the simplest (maybe some serialization facilities could be built for people but not a requirement to ship) (Originally published at: https://v2.jacky.wtf/post/f7f801b5-ad69-45ba-9c16-d9122994d8c4) |
Got a PR working with this. The idea is that on the call to render; one would pass in a map of tag names that would be detected in the code whose values map to modules that can probably implement a behavior for a tag. This covers my particular use case and matches a leaner approach that the other Elixir Liquid library satisfied. (Originally published at: https://v2.jacky.wtf/post/e70ac05d-6535-4b66-874f-a7d9e262ae0d) |
Great! Thanks for the PR! I will review it later today 👍 |
Hey there! I've been working to move https://koype.net/ to use this library over the unmaintained https://github.com/bettyblocks/liquid-elixir. It did work well but I had support for providing custom tags. It looks like this uses nimble-parsec so I'm not sure what would be required to extend this so custom tag support could be a tag. My use case was allowing templates to look up routes in my Phoenix application.
The text was updated successfully, but these errors were encountered: