HTML coding guidelines ====================== We use `Django templates `_ to author HTML. Linting HTML ~~~~~~~~~~~~ We use `curlylint `_ to lint templates and `djhtml `_ to format them. If you have installed Wagtail's testing dependencies (``pip install -e .[testing]``), you can check your code by running ``make lint``, and format your code by running ``make format``. Alternatively you can also run ``make lint-client`` for checking and ``make format-client`` for formatting frontend (html/css/js) only files. Principles ~~~~~~~~~~ * Write `valid HTML `_. We target the HTML5 doctype. * Write `semantic HTML `_. * Consult `ARIA Authoring Practices `_, in particular `No ARIA is better than Bad ARIA `_. * Attach JavaScript behavior with ``data-`` attributes, rather than classes or IDs. * For comments, use Django templates syntax instead of HTML.