"Jinja Snippets Flask" is a powerful and comprehensive extension designed to boost your productivity when working with Flask and Jinja in Visual Studio Code. This extension provides a rich collection of code snippets that cover a wide range of Jinja template engine functionalities, from basic template structures to complex control flows. Whether you're building a simple web application or a complex web service with Flask, our snippets can help you write Jinja templates faster and with fewer errors. The snippets include shortcuts for blocks, extends, imports, loops, conditional statements, macros, filters, comments, and much more.
Jinja is a fast, expressive, extensible templating engine. Special placeholders in the template allow writing code similar to Python syntax. Then the template is passed data to render the final document.
To start using the snippets simply type j. snippet_name.
- Example:
j.html
For
<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<link rel="stylesheet" href="style.css" />
<title>{% block title %}{% endblock %} - My Webpage</title>
{% endblock %}
</head>
<body>
<div id="content">{% block content %}{% endblock %}</div>
<div id="footer">
{% block footer %}
© Copyright 2024 by <a href="https://hackerwasii.com/">Waseem Akram💙</a>.
{% endblock %}
</div>
</body>
</html>
- To preview the selected snippet click
CTRL+SPACEBAR
. - To use the selected snippet simply click
TAB
.
All snippets support Tabstops
Some snippets providing Placeholders
some snippets likej.imp
support Choice
Key Features:
- Comprehensive set of Jinja2 snippets for Flask applications.
- Easy to use: just type the prefix and select the snippet from the IntelliSense suggestions.
- Covers a wide range of Jinja2 functionalities, from basic to advanced.
- Helps write code faster and reduces the chance of errors.
- Constantly updated with new snippets and improvements.
j.base
- Base Templatej.block
- Blockj.ext
- Extendsj.imp
- Importj.for
- For Loopj.if
- If Statementj.elif
- Elif Statementj.else
- Else Statementj.macro
- Macroj.set
- Setj.call
- Callj.filter
- Filterj.include
- Includej.comment
- Commentj.raw
- Rawj.autoescape
- Autoescapej.with
- Withj.do
- Doj.super
- Superj.end
- End
and many more...
- Open Extensions sidebar panel in Visual Studio Code.
View → Extensions
- Search for
Jinja Snippets Flask
- Click Install to install it.
- Click Reload to reload your editor
- Code > Preferences > File Icon Theme > Jinja Snippets Flask
- Open a Jinja file or HTML file and start typing!
- Alternatively, Open Visual Studio Code
- Press
Ctrl+P
to open the Quick Open dialog - Type
ext install WaseemAkram.jinja-snippets-flask
to find the extension - Click the
Install
button, then theEnable
button - Alternatively, you can install the extension from the Visual Studio Code Marketplace
If you have suggestions for improving the BashSnippets, please open an issue or submit a pull request.
MIT © Waseem Akram
If you like this extension, you can support me by:
- Star this repository on GitHub
- Follow me on GitHub
- Support me on Patreon
- Follow me on Facebook
- Follow me on Instagram
- Your support is greatly appreciated! 💙
Enjoy!