summaryrefslogtreecommitdiff
path: root/docs/internals/contributing/writing-code/javascript.txt
diff options
context:
space:
mode:
authorElif T. Kus <elifkus@gmail.com>2016-01-03 12:56:22 +0200
committerTim Graham <timograham@gmail.com>2016-01-22 12:12:17 -0500
commitbca9faae95db2a92e540fbd08505c134639916fe (patch)
tree92b34dd8ecf8cf5432c25d43292ebc83b7919350 /docs/internals/contributing/writing-code/javascript.txt
parent79d0a4fdb0d13ba6a843dace2b90ab44e856bd85 (diff)
Fixed #26020 -- Normalized header stylings in docs.
Diffstat (limited to 'docs/internals/contributing/writing-code/javascript.txt')
-rw-r--r--docs/internals/contributing/writing-code/javascript.txt16
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/internals/contributing/writing-code/javascript.txt b/docs/internals/contributing/writing-code/javascript.txt
index a3b34c564e..8b8534e384 100644
--- a/docs/internals/contributing/writing-code/javascript.txt
+++ b/docs/internals/contributing/writing-code/javascript.txt
@@ -9,7 +9,7 @@ Please follow these coding standards when writing JavaScript code for inclusion
in Django.
Code style
-----------
+==========
* Please conform to the indentation style dictated in the ``.editorconfig``
file. We recommend using a text editor with `EditorConfig`_ support to avoid
@@ -27,7 +27,7 @@ Code style
.. _javascript-patches:
JavaScript patches
-------------------
+==================
Django's admin system leverages the jQuery framework to increase the
capabilities of the admin interface. In conjunction, there is an emphasis on
@@ -41,7 +41,7 @@ production use (e.g. ``foo.min.js``). Any links to the file in the codebase
should point to the compressed version.
Compressing JavaScript
-~~~~~~~~~~~~~~~~~~~~~~
+----------------------
To simplify the process of providing optimized JavaScript code, Django
includes a handy Python script which should be used to create a "minified"
@@ -61,13 +61,13 @@ Please don't forget to run ``compress.py`` and include the ``diff`` of the
minified scripts when submitting patches for Django's JavaScript.
JavaScript tests
-----------------
+================
Django's JavaScript tests can be run in a browser or from the command line.
The tests are located in a top level ``js_tests`` directory.
Writing tests
-~~~~~~~~~~~~~
+-------------
Django's JavaScript tests use `QUnit`_. Here is an example test module:
@@ -101,12 +101,12 @@ Please consult the QUnit documentation for information on the types of
`assertions supported by QUnit <https://api.qunitjs.com/category/assert/>`_.
Running tests
-~~~~~~~~~~~~~
+-------------
The JavaScript tests may be run from a web browser or from the command line.
Testing from a web browser
-^^^^^^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~~~~~~
To run the tests from a web browser, open up ``js_tests/tests.html`` in your
browser.
@@ -119,7 +119,7 @@ over HTTP. To view code coverage:
* Open http://localhost:8000/js_tests/tests.html in your web browser.
Testing from the command line
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To run the tests from the command line, you need to have `Node.js`_ installed.