{"id":20830639,"url":"https://github.com/endlesstrax/python-template-snippets","last_synced_at":"2026-03-08T21:30:45.321Z","repository":{"id":126383598,"uuid":"153926835","full_name":"EndlessTrax/python-template-snippets","owner":"EndlessTrax","description":"A VS Code snippet extension for both the Jinja2 and Django template engines.","archived":false,"fork":false,"pushed_at":"2023-11-26T20:11:38.000Z","size":27,"stargazers_count":13,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T14:43:37.622Z","etag":null,"topics":["django-snippets","flask-snippets","hactoberfest","python-template-snippets","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=RickyWhite.python-template-snippets","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EndlessTrax.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"EndlessTrax"}},"created_at":"2018-10-20T16:45:23.000Z","updated_at":"2024-03-23T23:43:30.000Z","dependencies_parsed_at":"2024-04-22T23:50:44.115Z","dependency_job_id":"09fc42e6-fdea-43a0-aa95-968080c2640d","html_url":"https://github.com/EndlessTrax/python-template-snippets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpython-template-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpython-template-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpython-template-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpython-template-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EndlessTrax","download_url":"https://codeload.github.com/EndlessTrax/python-template-snippets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252962852,"owners_count":21832409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django-snippets","flask-snippets","hactoberfest","python-template-snippets","vscode","vscode-extension"],"created_at":"2024-11-17T23:25:18.265Z","updated_at":"2026-03-08T21:30:45.315Z","avatar_url":"https://github.com/EndlessTrax.png","language":null,"funding_links":["https://github.com/sponsors/EndlessTrax"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Python Template Snippets Logo\" width=\"200\"/\u003e\n  \n  # Python Template Snippets\n\n  ✨ **Supercharge your template development workflow** ✨\n\n  A comprehensive VS Code snippet collection for **Jinja2** and **Django** template engines.\n\n  [![GitHub stars](https://img.shields.io/github/stars/EndlessTrax/python-template-snippets?style=social)](https://github.com/EndlessTrax/python-template-snippets)\n  [![VS Code Marketplace](https://img.shields.io/badge/VS%20Code-Marketplace-blue?logo=visual-studio-code)](https://marketplace.visualstudio.com/items?itemName=RickyWhite.python-template-snippets)\n  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\n\u003c/div\u003e\n\n---\n\n## 🚀 Why Use This Extension?\n\nWriting template code can be tedious with all those brackets, tags, and syntax. This extension eliminates the repetitive typing by providing **smart, tab-completion snippets** for common Jinja2 and Django template patterns.\n\n**Stop typing this:**\n```html\n{% for item in items %}\n  \u003c!-- your code --\u003e\n{% endfor %}\n```\n\n**Start typing this:**\n```\nptfor → Tab → Fill in the blanks!\n```\n\n### ✨ Features\n\n- 🎯 **20+ carefully crafted snippets** for Jinja2 and Django\n- ⚡ **Lightning-fast** - Type `pt` prefix and let IntelliSense do the rest\n- 🎨 **Smart cursor positioning** - Jump to exactly where you need to type\n- 🔄 **Multi-cursor support** - Tab between placeholders seamlessly\n- 🛠️ **Framework-agnostic** - Works with Flask, Django, FastAPI, and any Python web framework\n- 📦 **Zero configuration** - Works out of the box\n\n---\n\n## 📦 Installation\n\n### From VS Code Marketplace (Recommended)\n\n1. Open VS Code\n2. Press `Ctrl+P` / `Cmd+P`\n3. Type `ext install RickyWhite.python-template-snippets`\n4. Press Enter and reload VS Code\n\n### Manual Installation\n\n1. Download the latest `.vsix` from [Releases](https://github.com/EndlessTrax/python-template-snippets/releases)\n2. Open VS Code\n3. Go to Extensions (`Ctrl+Shift+X` / `Cmd+Shift+X`)\n4. Click the `...` menu → `Install from VSIX`\n5. Select the downloaded file\n\n---\n\n## 🎯 Quick Start\n\n1. Open any HTML file in VS Code\n2. Type `pt` to see available snippets\n3. Select a snippet from the IntelliSense menu (or type the full prefix)\n4. Press `Tab` to trigger the snippet\n5. Fill in the placeholders and press `Tab` to jump between them\n\n### 💡 Pro Tip\nEnable tab completion in your VS Code settings for the best experience:\n```json\n{\n  \"editor.tabCompletion\": \"on\"\n}\n```\n\n---\n\n## 📚 Snippet Reference\n\nAll snippets use the `pt` prefix (short for \"Python Template\"). Here's the complete reference:\n\n### 🌐 General Snippets\n*Works with both Jinja2 and Django*\n\n| Prefix | Description | Output |\n|--------|-------------|---------|\n| `ptnew` | New HTML template file | Complete template with extends and blocks |\n| `ptvar` | Template variable | `{{ variable }}` |\n| `ptfilt` | Variable with filter | `{{ variable \\| filter }}` |\n| `ptcode` | Code block tag | `{% code %}` |\n| `ptblock` | Block tag | `{% block name %}...{% endblock %}` |\n| `ptext` | Extends tag | `{% extends 'base.html' %}` |\n| `ptsup` | Super function | `{{ super() }}` |\n| `ptfor` | For loop | `{% for item in items %}...{% endfor %}` |\n| `ptif` | If statement | `{% if condition %}...{% endif %}` |\n| `ptifel` | If/else statement | `{% if %}...{% else %}...{% endif %}` |\n| `ptelif` | If/elif/else statement | `{% if %}...{% elif %}...{% else %}...{% endif %}` |\n| `ptwith` | With statement | `{% with variable %}...{% endwith %}` |\n\n### 🔧 Jinja2-Specific Snippets\n*For Flask, FastAPI, and other Jinja2 projects*\n\n| Prefix | Description | Output |\n|--------|-------------|---------|\n| `ptj-url` | Static file URL | `{{ url_for('static', filename='file.css') }}` |\n| `ptj-mac` | Macro definition | `{% macro name %}...{% endmacro %}` |\n| `ptj-com` | Comment | `{# comment #}` |\n| `ptj-set` | Set variable | `{% set var = value %}` |\n\n### 🎨 Django-Specific Snippets\n*For Django projects*\n\n| Prefix | Description | Output |\n|--------|-------------|---------|\n| `ptd-url` | URL tag | `{% url 'view-name' args %}` |\n| `ptd-load` | Load tag library | `{% load static %}` |\n| `ptd-stat` | Static file | `{% static 'path/to/file' %}` |\n| `ptd-inc` | Include template | `{% include 'template.html' %}` |\n| `ptd-firstof` | First of variables | `{% firstof var1 var2 %}` |\n\n---\n\n## 💻 Usage Examples\n\n### Creating a New Template\n\nType `ptnew` and press Tab:\n\n```html\n{% extends 'base.html' %}\n\n{% block content %}\n  \u003c!-- Your cursor starts here --\u003e\n{% endblock content %}\n\n{% block scripts %}\n{% endblock scripts %}\n```\n\n### Adding a For Loop\n\nType `ptfor` and press Tab:\n\n```html\n{% for item in items %}\n  \u003c!-- Your cursor starts here --\u003e\n{% endfor %}\n```\n\nThen tab through: `item` → `items` → loop body\n\n### Django Static File\n\nType `ptd-stat` and press Tab:\n\n```html\n{% static 'css/style.css' %}\n```\n\n---\n\n## 🤝 Contributing\n\nFound a bug? Want a new snippet? Contributions are welcome!\n\n1. **Report Issues**: [Open an issue](https://github.com/EndlessTrax/python-template-snippets/issues)\n2. **Request Features**: Have an idea? Share it!\n3. **Submit PRs**: Fork, code, and submit a pull request\n\n### Suggesting New Snippets\n\nWhen requesting a new snippet, please include:\n- The template syntax you want added\n- Which framework it's for (Jinja2/Django/both)\n- A brief description of what it does\n\n---\n\n## 📝 Release Notes\n\nSee [GitHub Releases](https://github.com/EndlessTrax/python-template-snippets/releases) for the detailed version history and changelog.\n\n---\n\n## 💖 Support This Project\n\nThis extension is free and open source. If you find it helpful, consider:\n\n- ⭐ [Starring the repo](https://github.com/EndlessTrax/python-template-snippets)\n- 💰 [Sponsoring on GitHub](https://github.com/sponsors/EndlessTrax)\n- 🐦 [Sharing on social media](https://twitter.com/intent/tweet?text=Check%20out%20Python%20Template%20Snippets%20for%20VS%20Code!\u0026url=https://github.com/EndlessTrax/python-template-snippets)\n- 📝 [Writing a review](https://marketplace.visualstudio.com/items?itemName=RickyWhite.python-template-snippets\u0026ssr=false#review-details)\n\n---\n\n## 📜 License\n\nMIT © [Ricky White](https://github.com/EndlessTrax)\n\n---\n\n## 🙏 Acknowledgments\n\nCreated and maintained by [Ricky White](https://twitter.com/endlesstrax)\n\nSpecial thanks to all [contributors](https://github.com/EndlessTrax/python-template-snippets/graphs/contributors) who have helped improve this extension!\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Happy Coding! 🎉**\n\nMade with ❤️ for the Python community\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstrax%2Fpython-template-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendlesstrax%2Fpython-template-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstrax%2Fpython-template-snippets/lists"}