question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customize jinja parser

See original GitHub issue

Hey guys, I’m trying to use the cookiecutter to generate a code base for my k8s + Helm project. Helm uses “go templates” that has the same syntax like jinja templates, it causes conflicts, so I came up with a new feature… Jinja provides an ability to change it’s syntax by modifying the environment.

We can provide these parameters as object in cookiecutter.json

    {
        "_environment": {
            "variable_start_string": "[[",
            "variable_end_string": "]]"
        }
    }

WDYT?

Here is the PR #1089

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
adzhurinskijcommented, Nov 9, 2019

Hi guys.

I cannot use cookiecutter for Ansible or Kubernetes, because it vary hard with {% raw %} block. Code in files with this block is unreadable. Custom jinja configuration will solve the problem.

0reactions
insspbcommented, Jun 2, 2020

@wkerzendorf something is already possible with master version. Check already merged https://github.com/cookiecutter/cookiecutter/pull/1339

Read more comments on GitHub >

github_iconTop Results From Across the Web

J2Live - Online Jinja2 Parser |
J2Live is a live Jinja2 parser/renderer, you give it template, ... it locally or go wild with adding filters customized to your use...
Read more >
Jinja2 live parser
Jinja2 live parser. Template. Dear {{ name }}, {% if not asleep %} Once upon a time ... {% endif %}. Render. Dear·Jane,...
Read more >
API — Jinja Documentation (3.1.x)
This will create a template environment with a loader that looks up ... the file system or a different location to avoid parsing...
Read more >
Primer on Jinja Templating - Real Python
Create your first Jinja template; Render a Jinja template in Flask; Use for loops and conditional statements with Jinja; Nest Jinja templates ...
Read more >
creating templates in Python with Jinja module - ZetCode
Jinja tutorial shows how to create templates in Python with Jinja module. AdvertisementsPython Jinja module. Jinja is a template engine for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found