Spec-Zone.ru › Wagtail 2

HTML coding guidelines

We use Django templates to author HTML.

Linting HTML

We use jinjalint to lint templates. If you have installed Wagtail’s testing dependencies (pip install -e .[testing]), you can check your code by running make lint.

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.
  • Previous Python coding guidelines
  • Next CSS coding guidelines

Page contents

  • HTML coding guidelines
    • Linting HTML
    • Principles

© 2014-present Torchbox Ltd and individual contributors.
All rights are reserved.
Licensed under the BSD License.
https://docs.wagtail.org/en/v2.16.3/contributing/html_guidelines.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API