{"library":"prettier-plugin-django","title":"prettier-plugin-django","description":"Prettier plugin for formatting Django/Jinja templates and Twig/Melody files. Currently at version 0.5.18 with sporadic releases. It leverages the Melody parser to format .django, .jinja, .html, .twig files, offering Twig-specific options like separate print width, multi-tags, and control over quotes/objects. Unlike general Prettier, it targets template syntax with custom indentation and filter formatting. Supports configuration for non-standard tags and coding standards. Active development, but check GitHub for recent updates.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-django"],"cli":null},"imports":["module.exports = { plugins: ['prettier-plugin-django'] }","npm install prettier-plugin-django","// In .prettierrc: { \"tabWidth\": 4, \"plugins\": [\"prettier-plugin-django\"] }"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// 1. Install\nnpm install --save-dev prettier prettier-plugin-django\n\n// 2. Create .prettierrc.json\n{\n  \"tabWidth\": 4,\n  \"printWidth\": 80,\n  \"twigPrintWidth\": 80,\n  \"twigSingleQuote\": true,\n  \"plugins\": [\"prettier-plugin-django\"]\n}\n\n// 3. Format a Django template file\n// Run: prettier --write \"**/*.django\"\n\n// Example file: template.django\n// Before:\n{% if user.is_authenticated %} <p>Welcome, {{ user.username }}!</p> {% endif %}\n\n// After:\n{% if user.is_authenticated %}\n    <p>Welcome, {{ user.username }}!</p>\n{% endif %}","lang":"javascript","description":"Installs the plugin, configures prettier with Django-specific options, and formats a simple template.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}