Skip to content

About

Zed extension that formats and lints HTML templates with djLint. Supports Django, Jinja, Twig, Nunjucks, Liquid, Handlebars, Go templates, Mustache, Tera and Angular.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

djLint for Zed

Lints and formats HTML templates with djLint in Zed, through its language server. It works in HTML and in the languages of the template extensions: Django, Jinja2, HTML-Jinja, Twig, Nunjucks, Liquid, Handlebars, Mustache, Tera, Mako, Angular and Go HTML templates.

Installation

The extension isn't in Zed's extension registry yet. Until it is, install it as a dev extension, as the djLint docs describe.

It needs djLint 1.49 or newer, and looks for it in this order:

  1. The binary setting below.
  2. node_modules/.bin/djlint in the project, which npm i -D djlint puts there. The npm package comes with its own Python and runs on the node on PATH.
  3. djlint on PATH, such as one from uv tool install, pip, pipx or npm i -g.
  4. uv, which runs djLint with no install.

Usage

Findings appear in these languages as soon as the extension is installed. To format with djLint, make it the formatter of the languages you want:

{ "languages": { "Django": { "formatter": { "language_server": { "name": "djlint" } } } } }

To leave a language out, such as plain HTML, turn the server off for it:

{ "languages": { "HTML": { "language_servers": ["!djlint", "..."] } } }

Settings

djLint reads the project's configuration as usual. Settings from Zed win over it, and are described in the docs of the language server:

{
  "lsp": {
    "djlint": {
      "binary": { "path": "/path/to/djlint", "arguments": ["--lsp"] },
      "settings": { "profile": "django", "ignore": ["H013"] }
    }
  }
}

License

MIT

About

Zed extension that formats and lints HTML templates with djLint. Supports Django, Jinja, Twig, Nunjucks, Liquid, Handlebars, Go templates, Mustache, Tera and Angular.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages