mirror of
https://github.com/django/django.git
synced 2025-08-31 15:57:45 +00:00
Fixed #26020 -- Normalized header stylings in docs.
This commit is contained in:
parent
79d0a4fdb0
commit
bca9faae95
132 changed files with 1498 additions and 1464 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue