From 7d96f8e6186853a1947384d80153ba5a5db81bae Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Sun, 29 Jan 2017 21:55:27 +0100 Subject: [PATCH] Use code-block directive for snippets Correct spacing between sentences. Update URLs (http -> https) --- docs/features.rst | 8 ++++++-- docs/history.rst | 2 +- docs/index.rst | 6 +++--- docs/install.rst | 30 +++++++++++++++--------------- docs/services.rst | 6 +++--- docs/settings.rst | 1 - docs/tutorial.rst | 20 +++++++++++++++----- 7 files changed, 43 insertions(+), 30 deletions(-) diff --git a/docs/features.rst b/docs/features.rst index 765916a..4485b92 100644 --- a/docs/features.rst +++ b/docs/features.rst @@ -18,7 +18,9 @@ initialization code if the client IP address is detected as one from the :data:`ANALYTICAL_INTERNAL_IPS` setting. The default value for this setting is :data:`INTERNAL_IPS`. -Example:: +Example: + +.. code-block:: python ANALYTICAL_INTERNAL_IPS = ['192.168.1.45', '192.168.1.57'] @@ -45,7 +47,9 @@ logged in through the standard Django authentication system and the current user is accessible in the template context, the username can be passed to the analytics services that support identifying users. This feature is configured by the :data:`ANALYTICAL_AUTO_IDENTIFY` setting -and is enabled by default. To disable:: +and is enabled by default. To disable: + +.. code-block:: python ANALYTICAL_AUTO_IDENTIFY = False diff --git a/docs/history.rst b/docs/history.rst index 703bfa4..6939438 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -10,7 +10,7 @@ version numbers. Patch-level increments indicate bug fixes, minor version increments indicate new functionality and major version increments indicate backwards incompatible changes. -Version 1.0.0 is the last to support Django < 1.7. Users of older django +Version 1.0.0 is the last to support Django < 1.7. Users of older Django versions should stick to 1.0.0, and are encouraged to upgrade their setups. Starting with 2.0.0, dropping support for obsolete Django versions is not considered to be a backward-incompatible change. diff --git a/docs/index.rst b/docs/index.rst index 9630154..c922b9b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,10 +5,10 @@ django-analytical The django-analytical application integrates analytics services into a Django_ project. -.. _Django: http://www.djangoproject.com/ +.. _Django: https://www.djangoproject.com/ -:Package: http://pypi.python.org/pypi/django-analytical/ -:Source: http://github.com/jcassee/django-analytical +:Package: https://pypi.python.org/pypi/django-analytical/ +:Source: https://github.com/jcassee/django-analytical Overview diff --git a/docs/install.rst b/docs/install.rst index 0b25521..defae2b 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -74,26 +74,26 @@ HTML page, django-analytical provides four general-purpose template tags that will render the code needed for the services you are using. Your base template should look like this: -.. code-block:: html +.. code-block:: django - {% load analytical %} - - - - {% analytical_head_top %} + {% load analytical %} + + + + {% analytical_head_top %} - ... + ... - {% analytical_head_bottom %} - - - {% analytical_body_top %} + {% analytical_head_bottom %} + + + {% analytical_body_top %} - ... + ... - {% analytical_body_bottom %} - - + {% analytical_body_bottom %} + + Instead of using the generic tags, you can also just use tags specific for the analytics service(s) you are using. See :ref:`services` for diff --git a/docs/services.rst b/docs/services.rst index 57dec35..fd4dfd1 100644 --- a/docs/services.rst +++ b/docs/services.rst @@ -19,7 +19,7 @@ django-analytical, please create an issue on the project Currently supported services: .. toctree:: - :maxdepth: 1 - :glob: + :maxdepth: 1 + :glob: - services/* + services/* diff --git a/docs/settings.rst b/docs/settings.rst index 46b203a..4865049 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -6,7 +6,6 @@ Here's a full list of all available settings, in alphabetical order, and their default values. - .. data:: ANALYTICAL_AUTO_IDENTIFY Default: ``True`` diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 976ff19..27d272c 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -29,7 +29,9 @@ Setting up basic tracking To get started with django-analytical, the package must first be installed. You can download and install the latest stable package from -the Python Package Index automatically by using ``easy_install``:: +the Python Package Index automatically by using ``easy_install``: + +.. code-block:: bash $ easy_install django-analytical @@ -37,7 +39,9 @@ For more ways to install django-analytical, see :ref:`installing-the-package`. After you install django-analytical, you need to add it to the list of -installed applications in the ``settings.py`` file of your project:: +installed applications in the ``settings.py`` file of your project: + +.. code-block:: python INSTALLED_APPS = [ ... @@ -46,7 +50,9 @@ installed applications in the ``settings.py`` file of your project:: ] Then you have to add the general-purpose django-analytical template tags -to your base template:: +to your base template: + +.. code-block:: django {% load analytical %} @@ -69,7 +75,9 @@ to your base template:: Finally, you need to configure the Clicky Site ID and the Crazy Egg account number. Add the following to your project :file:`settings.py` -file (replacing the ``x``'s with your own codes):: +file (replacing the ``x``'s with your own codes): + +.. code-block:: python CLICKY_SITE_ID = 'xxxxxxxx' CRAZY_EGG_ACCOUNT_NUMBER = 'xxxxxxxx' @@ -110,7 +118,9 @@ protocol version. In order to filter on protocol version in Crazy Egg, you need to include the visitor IP protocol version in the Crazy Egg tracking code. -The easiest way to do this is by using a context processor:: +The easiest way to do this is by using a context processor: + +.. code-block:: python def track_ip_proto(request): addr = request.META.get('HTTP_X_FORWARDED_FOR', '')