Twig 範本 Linter 與格式化工具
djLint 可以 lint 並格式化 Twig 範本。設定 nunjucks profile,讓規則與格式化方式符合這類範本。
Pebble(Java)範本與 Twig 相容,因此它們也請使用同一個 profile。
djlint /path/to/templates --profile=nunjucks在專案的 pyproject.toml、djlint.toml / .djlint.toml 或 .djlintrc 檔案中設定 djLint。
[tool.djlint]profile = "nunjucks"profile = "nunjucks"{ "profile": "nunjucks" }