{"library":"prettier-html-templates","title":"prettier-html-templates","description":"Library for building Prettier plugins to format HTML files containing template language markup such as Jinja, ERB, and others. Current stable version is 0.1.0. This package provides the infrastructure to embed template language constructs into Prettier's HTML formatting pipeline. It is the base for plugins like prettier-plugin-eex (Elixir) and prettier-plugin-erb (Ruby). Key differentiator: it enables unified formatting of mixed HTML/template files using Prettier's standard HTML printer, whereas alternatives often rely on language-specific formatters.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-html-templates"],"cli":null},"imports":["import prettierPluginHtmlTemplates from 'prettier-html-templates'","import { getFormattedHtml } from 'prettier-html-templates'","import { PRINTER } from 'prettier-html-templates'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import prettier from 'prettier';\nimport prettierPluginHtmlTemplates from 'prettier-html-templates';\n\nconst code = '<div class=\"<% if (condition) { %>active<% } %>\">Content</div>';\nconst options = {\n  parser: 'html',\n  plugins: [prettierPluginHtmlTemplates],\n  printWidth: 80\n};\n\nconst formatted = await prettier.format(code, options);\nconsole.log(formatted);","lang":"javascript","description":"Shows how to use the plugin with Prettier to format HTML containing template syntax.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}