prettier-plugin-jinja-template but with patches to work with Askama
Go to file
Alexander Minkin 6e119d7583
fix(README): 🐛 fix command
2023-08-22 15:51:18 +03:00
.github/workflows fix failing tests on node 14 2022-12-01 19:27:58 +01:00
src chore: 🎨 rebrand 2023-08-19 18:27:59 +03:00
test fix(tests&meta): Make tests work and edit metadata 2023-08-22 15:49:03 +03:00
.gitignore initial commit 2022-11-18 20:05:06 +01:00
.npmrc fix(tests&meta): Make tests work and edit metadata 2023-08-22 15:49:03 +03:00
.prettierignore fix indentation on readme example 2022-11-18 21:22:28 +01:00
.prettierrc initial commit 2022-11-18 20:05:06 +01:00
README.md fix(README): 🐛 fix command 2023-08-22 15:51:18 +03:00
babel.config.js initial commit 2022-11-18 20:05:06 +01:00
jest.config.js initial commit 2022-11-18 20:05:06 +01:00
package-lock.json chore: 🎨 rebrand 2023-08-19 18:27:59 +03:00
package.json fix(tests&meta): Make tests work and edit metadata 2023-08-22 15:49:03 +03:00
tsconfig.json update plugin to support prettier v3 2023-08-12 20:32:28 +02:00

README.md

prettier-plugin-askama-template

prettier-plugin-jinja-template but with patches to work with Askama.

Install

npm install --save-dev prettier https://git.fetbuk.ru/WerySkok/-/packages/npm/prettier-plugin-askama-template/1.0.0/files/2

Add the plugin to your .prettierrc:

{
  "plugins": ["prettier-plugin-askama-template"]
}

Use

To format basic .html files, you'll have to override the used parser inside your .prettierrc:

{
  "overrides": [
    {
      "files": ["*.html"],
      "options": {
        "parser": "askama-template"
      }
    }
  ]
}

Run it on all html files in your project:

npx prettier --write **/*.html

If you don't have a prettier config you can run the plugin with this command:

npx prettier --write **/*.html --plugin=prettier-plugin-askama-template