跳到內容

Mustache 範本 Linter 與格式化工具

djLint 可以 lint 並格式化 Mustache 範本。設定 handlebars profile,讓規則與格式化方式符合這類範本。

什麼是 Mustache?

終端機視窗
djlint /path/to/templates --profile=handlebars

在專案的 pyproject.toml、djlint.toml / .djlint.toml 或 .djlintrc 檔案中設定 djLint。

pyproject.toml
[tool.djlint]
profile = "handlebars"
djlint.toml / .djlint.toml
profile = "handlebars"
.djlintrc
{ "profile": "handlebars" }