From 6db788a55034c450bb5340b8b152bf7f9e16a74a Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Sun, 23 Sep 2018 12:54:39 +0100 Subject: [PATCH] Add docs for indentation & spacing --- docs/contributing.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/contributing.rst b/docs/contributing.rst index 4ee6d18d5..05f51731c 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -97,6 +97,34 @@ closing the ``"`` before it should have been. That's all there is in terms of guidelines, so I hope it's not too daunting. +Indentation & Spacing +..................... + +When it comes to indentation: + +* For Python, the rule is: follow pep8 and use 4 spaces. +* For Javascript, CSS, and HTML, please use 1 tab. + +Additionally, Django templates making use of block elements like ``{% if %}``, +``{% for %}``, and ``{% block %}`` etc. should be indented: + +Good: + +.. code:: html + + {% block stuff %} +

This is the stuff

+ {% endblock %} + +Bad: + +.. code:: html + + {% block stuff %} +

This is the stuff

+ {% endblock %} + + The Code of Conduct ===================