chore: 🎨 rebrand

This commit is contained in:
Alexander Minkin 2023-08-19 18:27:59 +03:00
parent bea4b534bc
commit 559b2b0506
Signed by: WerySkok
GPG key ID: 88E9A2F3AFE44C30
5 changed files with 20 additions and 22 deletions

View file

@ -1,17 +1,16 @@
# prettier-plugin-jinja-template # prettier-plugin-askama-template
[prettier-plugin-jinja-template](https://github.com/davidodenwald/prettier-plugin-jinja-template) but with patches to work with Askama.
Formatter plugin for jinja2 template files.
## Install ## Install
```bash ```bash
npm install --save-dev prettier prettier-plugin-jinja-template npm install --save-dev prettier https://git.fetbuk.ru/WerySkok/prettier-plugin-askama-template.git
``` ```
Add the plugin to your `.prettierrc`: Add the plugin to your `.prettierrc`:
```json ```json
{ {
"plugins": ["prettier-plugin-jinja-template"] "plugins": ["prettier-plugin-askama-template"]
} }
``` ```
@ -24,7 +23,7 @@ To format basic .html files, you'll have to override the used parser inside your
{ {
"files": ["*.html"], "files": ["*.html"],
"options": { "options": {
"parser": "jinja-template" "parser": "askama-template"
} }
} }
] ]
@ -38,5 +37,5 @@ npx prettier --write **/*.html
If you don't have a prettier config you can run the plugin with this command: If you don't have a prettier config you can run the plugin with this command:
```bash ```bash
npx prettier --write **/*.html --plugin=prettier-plugin-jinja-template npx prettier --write **/*.html --plugin=prettier-plugin-askama-template
``` ```

6
package-lock.json generated
View file

@ -1,11 +1,11 @@
{ {
"name": "prettier-plugin-jinja-template", "name": "prettier-plugin-askama-template",
"version": "1.0.0", "version": "1.0.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "prettier-plugin-jinja-template", "name": "prettier-plugin-askama-template",
"version": "1.0.0", "version": "1.0.0",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
@ -17,7 +17,7 @@
"typescript": "^5.1.6" "typescript": "^5.1.6"
}, },
"peerDependencies": { "peerDependencies": {
"prettier": "^2.0.0" "prettier": "^3.0.0"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {

View file

@ -1,25 +1,23 @@
{ {
"name": "prettier-plugin-jinja-template", "name": "prettier-plugin-askama-template",
"version": "1.0.0", "version": "1.0.0",
"description": "Prettier plugin for formatting jinja templates.", "description": "prettier-plugin-jinja-template but with patches to work with Askama.",
"author": "David Odenwald", "author": "David Odenwald",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/davidodenwald/prettier-plugin-jinja-template.git" "url": "git+https://git.fetbuk.ru/WerySkok/prettier-plugin-askama-template.git"
}, },
"bugs": { "bugs": {
"url": "https://github.com/davidodenwald/prettier-plugin-jinja-template/issues" "url": "https://git.fetbuk.ru/WerySkok/prettier-plugin-askama-template/issues"
}, },
"homepage": "https://github.com/davidodenwald/prettier-plugin-jinja-template#readme", "homepage": "https://git.fetbuk.ru/WerySkok/prettier-plugin-askama-template#readme",
"keywords": [ "keywords": [
"prettier", "prettier",
"plugin", "plugin",
"template", "template",
"html", "html",
"jinja", "askama"
"jinja2",
"flask"
], ],
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {

View file

@ -3,14 +3,14 @@ import { parse } from "./parser";
import { print, embed, getVisitorKeys } from "./printer"; import { print, embed, getVisitorKeys } from "./printer";
import { Parser, Printer, SupportLanguage } from "prettier"; import { Parser, Printer, SupportLanguage } from "prettier";
const PLUGIN_KEY = "jinja-template"; const PLUGIN_KEY = "askama-template";
export const languages: SupportLanguage[] = [ export const languages: SupportLanguage[] = [
{ {
name: "JinjaTemplate", name: "AskamaTemplate",
parsers: [PLUGIN_KEY], parsers: [PLUGIN_KEY],
extensions: [".jinja", ".jinja2", ".j2", ".html"], extensions: [".jinja", ".jinja2", ".j2", ".html", "askama"],
vscodeLanguageIds: ["jinja"], vscodeLanguageIds: ["askama"],
}, },
]; ];

View file

@ -42,4 +42,5 @@ export const nonClosingStatements = [
"from", "from",
"extends", "extends",
"pluralize", "pluralize",
"when"
]; ];