djLint is a formatter and linter designed specifically for HTML templates. Generic HTML tools often struggle when markup is mixed with template constructs, while template engines themselves generally do not enforce consistent HTML formatting.
djLint handles both layers together, making it useful for projects built with Django templates, Jinja, Twig, Nunjucks, Handlebars, Liquid and several other templating systems. It can be used directly from the command line, incorporated into automated development workflows, or connected to supported editors. Profiles tailor parsing and formatting behaviour to particular template languages, allowing one tool to cover projects that mix conventional HTML with server-side or static-site templating syntax.
This is free and open source software.
Key Features
- Reformats indentation, element case, whitespace and attribute layout while preserving embedded template constructs.
- Checks markup for structural problems including orphaned and incorrectly closed tags.
- Detects accessibility issues such as images without appropriate alternative text.
- Provides checks for hard-coded URLs and numerous other correctness and style problems.
- Supports Django, Jinja, Twig, Nunjucks, Handlebars, Liquid, Go templates, Angular, Mustache, Tera and Askama.
- Offers language-specific profiles that adjust formatting and linting behaviour for individual template engines.
- Can check whether files conform to the expected formatting without modifying them.
- Integrates with pre-commit for automatic formatting and lint checks before changes are committed.
- Provides configuration options for selecting, ignoring and customising individual linting rules.
- Offers integrations for editors and development environments including VS Code, Neovim and Sublime Text.
Website: github.com/djlint/djLint
Support:
Developer: Christopher Pickering and contributors
License: GNU General Public License v3.0
djLint is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| HTML Linters | |
|---|---|
| HTMLHint | Static code analysis tool |
| v.Nu | Catch mistakes in HTML, CSS and SVG |
| SuperHTML | HTML validator, formatter and language server with editor integration |
| djLint | Supports Jinja, Django, Handlebars and related template languages |
| markuplint | HTML linter for markup developers |
| LintHTML | HTML5 linter and validator |
| HTML-validate | Offline HTML5 validator |
| HTML ESLint | ESLint plugin for linting HTML files |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.