From 1dd5b2ac62547a7a1f4f6ed9941dc5b543662860 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Fri, 4 Apr 2025 14:06:03 +0200 Subject: [PATCH] Fix Sphinx documentation issues, add RTD configuration --- .readthedocs.yaml | 18 ++++++++++++++++++ docs/services/google_analytics_gtag.rst | 6 +++--- docs/services/google_analytics_js.rst | 20 ++++++++++---------- docs/services/matomo.rst | 4 ++-- tox.ini | 2 +- 5 files changed, 34 insertions(+), 16 deletions(-) create mode 100644 .readthedocs.yaml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..1a89680 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,18 @@ +# Read the Docs configuration file +# https://docs.readthedocs.io/en/stable/config-file/v2.html + +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.12" + +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt diff --git a/docs/services/google_analytics_gtag.rst b/docs/services/google_analytics_gtag.rst index 1a97cf5..a5f6f24 100644 --- a/docs/services/google_analytics_gtag.rst +++ b/docs/services/google_analytics_gtag.rst @@ -26,7 +26,7 @@ application to :const:`INSTALLED_APPS` in your project Next you need to add the Google Analytics template tag to your templates. This step is only needed if you are not using the generic :ttag:`analytical.*` tags. If you are, skip to -:ref:`google-analytics-configuration`. +:ref:`google-analytics-configuration-gtag`. The Google Analytics tracking code is inserted into templates using a template tag. Load the :mod:`google_analytics_gtag` template tag library and @@ -43,7 +43,7 @@ template. Insert the tag at the bottom of the HTML head:: ... -.. _google-analytics-configuration: +.. _google-analytics-configuration-gtag: Configuration ============= @@ -54,7 +54,7 @@ code, you also need to set-up the domain. Finally, you can add custom segments for Google Analytics to track. -.. _google-analytics-property-id: +.. _google-analytics-gtag-property-id: Setting the property ID ----------------------- diff --git a/docs/services/google_analytics_js.rst b/docs/services/google_analytics_js.rst index b064d2e..c575bf8 100644 --- a/docs/services/google_analytics_js.rst +++ b/docs/services/google_analytics_js.rst @@ -26,7 +26,7 @@ application to :const:`INSTALLED_APPS` in your project Next you need to add the Google Analytics template tag to your templates. This step is only needed if you are not using the generic :ttag:`analytical.*` tags. If you are, skip to -:ref:`google-analytics-configuration`. +:ref:`google-analytics-configuration-js`. The Google Analytics tracking code is inserted into templates using a template tag. Load the :mod:`google_analytics_js` template tag library and @@ -43,7 +43,7 @@ template. Insert the tag at the bottom of the HTML head:: ... -.. _google-analytics-configuration: +.. _google-analytics-configuration-js: Configuration ============= @@ -54,7 +54,7 @@ code, you also need to set-up the domain. Finally, you can add custom segments for Google Analytics to track. -.. _google-analytics-property-id: +.. _google-analytics-js-property-id: Setting the property ID ----------------------- @@ -117,7 +117,7 @@ By default, display advertising features are disabled. .. _`Display Advertising features`: https://support.google.com/analytics/answer/3450482 -.. _google-analytics-internal-ips: +.. _google-analytics-js-internal-ips: Internal IP addresses --------------------- @@ -131,7 +131,7 @@ setting, the tracking code is commented out. It takes the value of important information about detecting the visitor IP address. -.. _google-analytics-custom-variables: +.. _google-analytics-js-custom-variables: Custom variables ---------------- @@ -165,7 +165,7 @@ context processor, the latter clobbers the former. .. _`custom variables`: https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs#custom-vars -.. _google-analytics-anonimyze-ips: +.. _google-analytics-js-anonimyze-ips: Anonymize IPs ------------- @@ -183,7 +183,7 @@ By default, IPs are not anonymized. .. _`IP anonymization`: https://support.google.com/analytics/bin/answer.py?hl=en&answer=2763052 -.. _google-analytics-sample-rate: +.. _google-analytics-js-sample-rate: Sample Rate ----------- @@ -199,7 +199,7 @@ integer value. .. _`Sample Rate`: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#sampleRate -.. _google-analytics-site-speed-sample-rate: +.. _google-analytics-js-site-speed-sample-rate: Site Speed Sample Rate ---------------------- @@ -218,7 +218,7 @@ integer value. .. _google-analytics-cookie-expiration: Cookie Expiration ----------------------- +----------------- You can configure the `Cookie Expiration`_ feature by setting the :const:`GOOGLE_ANALYTICS_COOKIE_EXPIRATION` configuration setting:: @@ -230,7 +230,7 @@ The value is the cookie expiration in seconds or 0 to delete the cookie when the .. _`Cookie Expiration`: https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_setsessioncookietimeout Custom Javascript Source ----------------------- +------------------------ You can configure a custom URL for the javascript file by setting the :const:`GOOGLE_ANALYTICS_JS_SOURCE` configuration setting:: diff --git a/docs/services/matomo.rst b/docs/services/matomo.rst index d6a5b83..2aad059 100644 --- a/docs/services/matomo.rst +++ b/docs/services/matomo.rst @@ -1,6 +1,6 @@ -================================== +==================================================== Matomo (formerly Piwik) -- open source web analytics -================================== +==================================================== Matomo_ is an open analytics platform currently used by individuals, companies and governments all over the world. diff --git a/tox.ini b/tox.ini index 9cc4be0..1da9e0c 100644 --- a/tox.ini +++ b/tox.ini @@ -59,7 +59,7 @@ commands = bandit {posargs:-r analytical} -v description = Clean up bytecode and build artifacts skip_install = true deps = pyclean -commands = pyclean {posargs:. --debris --erase requirements.txt tests/unittests-report.xml --yes} +commands = pyclean {posargs:. --debris --erase requirements.txt docs/_build/**/* docs/_build/ tests/unittests-report.xml --yes} [testenv:docs] description = Build the HTML documentation