Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
clarify why addtoblock on single line is important
Browse files Browse the repository at this point in the history
  • Loading branch information
vxsx committed Sep 11, 2015
1 parent 3990cf6 commit 23568ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/guidelines/markup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ Indentation

- Always add an indent after Django tags such as ``{% if %}``, ``{% forloop %}``, ``{% block %}`` and so on.
- Use single lines within ``{% addtoblock %}`` for **files** and multilines for ``<code>``.
It is important because of how sekizai works. Basically if two scripts are
added through ``addtoblock`` and the contents of the block are the same
they are merged. That way you never have duplicate jQuery's on the page.
The caveat than is that the whitespace around that script tag must match.
To avoid mistakes we always do them in single line.
- **Code readability** always wins.

.. code-block:: django
Expand Down

0 comments on commit 23568ec

Please sign in to comment.