Sphinx extension for plausible.io analytics
Project description
Sphinx extension for plausible.io
This extension adds the https://plausible.io script tags to a Sphinx project. It doesn't change the template, it uses the standard Sphinx hooks to insert javascript directly into any template (that uses the standard Sphinx stuff).
This is currently being tested but in production, please verify it does the correct thing for you.
Installation
Install the Python package: on pip it is sphinx-plausible
.
Usage
Add sphinx_plausible
to extensions
:
extensions = [
"sphinx_plausible",
]
Configuration options:
-
plausible_domain
(required): The domain name, likemy.domain.org
. Can be a list which will be joined by commas. -
plausible_script
(defaulthttps://plausible.io/js/script.js
): The URL to the script to load If you want to use the "proxying the script" idea, download the script and put it inhtml_static_path
and add the filename (relative tohtml_static_path
) here instead of the absolute path. (in the future we can automatically download and cache) -
plausible_enabled
(defaultTrue
): Should plausible be active? You might want to disable it on all you test deployments and so on. DefaultTrue
. You can limit to only the official deployment with something such as:import os plausible_enabled = ( 'GITHUB_ACTION' in os.environ and os.environ.get('GITHUB_REPOSITORY', '').lower() == 'aaltoscicomp/scicomp-docs' and os.environ.get('GITHUB_REF') == 'refs/heads/master' )
Status and development
Beta but works as of 2022 - improvements and feature requests are still welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sphinx_plausible-0.1.0.tar.gz
.
File metadata
- Download URL: sphinx_plausible-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243400e30186c36b147ded4aeea1f6ae67007dc73892751b271bdc41b71eccb2 |
|
MD5 | 07c15f416c0f1ad227ea5f38e10969f1 |
|
BLAKE2b-256 | 115e151dda5182e77adfda6350babf378efbdf619f629475dd05c31a3f53e31f |
File details
Details for the file sphinx_plausible-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: sphinx_plausible-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c27ed4c6c23577a5ee9ee613ac09054276963a8842cd58933f9335c4e3e8b112 |
|
MD5 | 8b3e8d6fdf4a1fec3c5a4481f5f5b9dc |
|
BLAKE2b-256 | a0ee0d0d13683cc7854fbf76e17e9ebd88df1862cc0877842fc389d0e39bb4a4 |