Conditionally creating directories in cookiecutter
I wanted my datasette-plugin cookiecutter template to create empty and directories if the user replied to the and prompts.
3 posts tagged “templating”.
I wanted my datasette-plugin cookiecutter template to create empty and directories if the user replied to the and prompts.
I decided to implement a custom Jinja template block tag for my datasette-render-markdown plugin. I wanted the tag to work like this: A basic Jinja extension After some fiddling around with GitHub…
Here's how to format a number in Jinja with commas for thousands, without needing any custom filters or template functions: {{ "{:,}".format(row count) }} Output looks like this: 179,119 Bonus: here's…