DEV Community

Cover image for Changing copier template strings (_endops)
Waylon Walker
Waylon Walker

Posted on • Originally published at waylonwalker.com

4 2

Changing copier template strings (_endops)

I'm on a journey to template out all the boilerplate files in my life and I am currently playing with copier to see if it fits these needs

I was completely stuck for awhile. copier was not replacing my template variables. I found out that adding all these _endops fixed it. Now It will support all of these types of variable wrappers

# copier.yml
_templates_suffix: .jinja
_envops:
  block_end_string: "%}"
  block_start_string: "{%"
  comment_end_string: "#}"
  comment_start_string: "{#"
  keep_trailing_newline: true
  variable_end_string: "}}"
  variable_start_string: "{{"
Enter fullscreen mode Exit fullscreen mode

!RTFM: Later I read the docs and realized that copier defaults to using [[ and ]] for its templates unlike other tools like jinja or cookiecutter.


This is a TIL, it will likely play a small role in a larger post later.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay