News for hackers. Stuff that matters.
Re:A Codebase That Makes Codebases by eclipticplane on Wednesday May 10, 2023 @11:15AM (#35888577)
For the first Jinja2 template pass, you could swap the Jinja2 delimiters rather than mess with {% raw %} tags: https://jinja.palletsprojects.com/en/3.1.x/api/#jinja2.Envir...
Re:A Codebase That Makes Codebases by czue on Wednesday May 10, 2023 @11:34AM (#35888899)
Whoa, are you saying I can tell Jinja to use some other combination of tag markers instead of {% %} and {{ }}? I had no idea you could do that. Where were you four years ago?!

Seriously though, thanks. That sounds like a much better option. Wasn't totally clear how to do it from the link you sent but will look closer into it.

Re:A Codebase That Makes Codebases by eclipticplane on Wednesday May 10, 2023 @11:38AM (#35888943)
For Django specifically, I believe you need to pass in a dotted path to a method that returns a Jinja2 `Environment`. There's an example in the docs: https://docs.djangoproject.com/en/4.2/topics/templates/#djan...

And you'd set something like `Environment(block_start_string="[%", block_end_string="%]")`

Re:A Codebase That Makes Codebases by czue on Wednesday May 10, 2023 @11:43AM (#35889009)
Awesome, thanks! I think I'll have to do the equivalent thing in cookiecutter, but this gives me a good path to go down.