Coder Social home page Coder Social logo

Comments (4)

NikolaLohinski avatar NikolaLohinski commented on May 22, 2024

Hi @mitsuhiko . Thanks for taking interest in my request. Any news on this feature ?

from minijinja.

mitsuhiko avatar mitsuhiko commented on May 22, 2024

@NikolaLohinski i looked into it recently again and it's quite a pain to implement and I wasn't sure if this feature is really that useful since editors also won't be able to handle custom Jinja delimiters. I just added raw tags, could they be helpful instead? (#69).

from minijinja.

NikolaLohinski avatar NikolaLohinski commented on May 22, 2024

Hi @mitsuhiko thanks for answering.

Regarding the raw tag : it would not help me because it would require me to escape every piece of conflicting delimiter every time I encounter them and there is lot.

Regarding editors : I don't understand how this is relevant to the feature itself. For sure most editors won't be able to parse jinja files with other delimiters but usually (at least for me), you want the file to be highlighted with the editor config for the underlying language, not for jinja itself. Should you have to template Python files (for whatever weird reason), you'd want the editor to show Python, not plain text with Jinja. My personal use case is to template HCL files.

Finally, if you consider it hurtful to implement, I can definitely look into it and take a shot at it if you would be so kind to accept a PR, and ideally give some thoughts on how you'd envision it.

from minijinja.

mitsuhiko avatar mitsuhiko commented on May 22, 2024

I would be open to a PR if it does not pull in a new dependency. There are however definitely some API limitations right now that would have to be worked with. For one a new Settings object or similar could be added that's passed between the environment, template and the meta API and the lexer and other internals.

The tricky bit will be that using memstr internally will no longer work. For efficiently parsing arbitrary delimiters one would probably want to use something like aho-corasick except i don't want to add a dependency. If aho-corasick turns out useful, it could be added as an optional feature with the extra dependency.

from minijinja.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.