{"library":"prettier-plugin-twig-melody","title":"Prettier Plugin for Twig/Melody","description":"A Prettier plugin that formats .twig, .html.twig, and .melody.twig files using the Melody parser. Version 0.4.6 is the latest stable release. It integrates with Prettier to provide consistent formatting for Twig templates used in Melody-based UI frameworks. Key differentiators include support for custom Twig extensions via twigMelodyPlugins, multi-tag handling (e.g., nav/endnav), and options to follow Symfony coding standards. It has several configuration options (twigSingleQuote, twigPrintWidth, twigAlwaysBreakObjects, etc.) but is not actively maintained (last release 2021, repository archived).","language":"javascript","status":"deprecated","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-plugin-twig-melody"],"cli":null},"imports":["Use via Prettier configuration: plugins: [\"prettier-plugin-twig-melody\"]","Add options to .prettierrc: { \"twigSingleQuote\": true, \"twigPrintWidth\": 80 }","const prettier = require('prettier'); prettier.format(code, { parser: 'twig', plugins: ['prettier-plugin-twig-melody'] })"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Install\nnpm install --save-dev prettier prettier-plugin-twig-melody\n\n# Format a .twig file via CLI\nnpx prettier --write \"**/*.twig\"\n\n# Programmatic usage\nconst prettier = require('prettier');\nconst code = `{% for item in items %}\n    <li>{{ item.name }}</li>\n{% endfor %}`;\nprettier.format(code, {\n  parser: 'twig',\n  plugins: ['prettier-plugin-twig-melody'],\n  twigSingleQuote: true,\n  twigPrintWidth: 80\n}).then(result => console.log(result));","lang":"javascript","description":"Demonstrates installing the plugin, formatting via CLI, and using the Prettier API with the plugin.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}