-
Notifications
You must be signed in to change notification settings - Fork 14
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
Can this be extended to support expression tags in apache config? #13
Comments
Correct jsp and jinja expressions tags seems more functional to me too. I am not sure if we can embed these expression tags (jsp/jinja) in apache style configs and modify parser you wrote to understand such expression language as well. Opinion? |
It seems that it should be easy to parse stuff out of But that would not work with vanilla Apache configs that use Apache expression tags. So may be the way to go is to have configurable expression engine to support both cases - Apache and Jinja expression languages...? |
Yes thats true. Configurable/pluggable expression engine should be a way forward. If we are able to do that then this library will become super powerful I guess. Also I am not sure if jinja is the best one out there, you know of something better than jinja? |
Do you have such a use-case in your application for which you created this parser? |
No, my config files do not happen to use expression tags of any kind. But I think I could try to add those for the greater good. Or you can come up with a PR. ;-) |
One thing I do not quite get is your use-case... Do you need this parser to actually evaluate expression tags? Or just parse/dump them untouched? I wonder how reasonable would be to evaluate the expression tags given they tend to rely upon HTTP request runtime variables.... |
I guess this would be bit difficult but this can be configurable too (for some straight forward configs users can opt for an option to evaluate expressions inside the parser itself).
It doesn't have to an HTTP request runtime variables everytime. Evaluating expressions gives users flexibility to generate dynamic configurations with less config lines. For example users can write loops or write conditional statements. Let me know if you think otherwise. |
Hold on, are you talking about using this parser with the new projects, not related to existing Apache-like configs? Because original Apache config file syntax does not seem to support loops, just conditionals. Is that correct? |
Correct. I mean this parser can be extended to support conditional statements and loops. So at the end this parser will be able to parse all the apache config files along with files having expressions from jinja/jsp/apache (basically a pluggable expression language syntax). I am not sure why Apache Config file syntax does not support loops. Though I am not sure whether you even intended to have such support in this library. Apologies for raising this as an issue if you feel this is out of the scope of this project. |
BTW, the parser in its current state can parse |
Thanks for adding the test case. I guess adding an ability to evaluate the expressions will make this more powerful. |
Not sure if you would want to check https://docs.saltstack.com/en/latest/ref/renderers/ |
I am not sure whether this parser can be extended to support expression tags, please comment. Something like jsp expression tags or something in these lines http://jinja.pocoo.org/
The text was updated successfully, but these errors were encountered: