Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

sphinxext-pwa

🛑 STOP 🛑

This technology is highly experimental and volatile. Individuals using this extension should expect the following:

  • completely random breakage
  • excessive data usage
  • excessive battery life drain
  • completely breaking your sphinx website

Current Issues

  • iOS is only partially working
    • For some weird reason, the service worker is getting killed and not being reactivated consistently.

See issues for more information.

Introduction

Progressive Web Applications, also known as PWAs, are a fantastic technology that enables seemless integration between websites and mobile devices. It empowers websites with the ability to present itself as a native-style application; complete with notifications and offline support. This extension's goal is to provide a "close as possible" integration between Sphinx and PWAs.

Installation

Installation is pretty easy but has a couple major points.

First, you need to add this dependency to your extensions list in conf.py.

extensions = [
    "sphinxext.pwa",
]

The extension will automatically prepopulate data for the manifest that is required for PWAs. However, setting the icons is mandatory. pwa_icons is a configuration variable that accepts a list of arrays. The nested array must have index 0 be the directory of the icon. The second 1 index must be string list of sizes of that icon.

IMPORTANT: Icons must be placed at the root of the _static directory. Subdirectories will not work.

pwa_icons = [["_static/myicon.webp", "48x48"]]

This extension does require NodeJS >= 16. If you are deploying on ReadTheDocs, you need to add or customize the build config as shown here. Once this is done, that should be all that is required to turn your Sphinx website into a Progressive Web Application!

Configuration

PWAs have a lot of configuration. For details on accepted inputs, see the Mozilla documentation. Only a limited subset of options are exposed. Below are a list of exposed manifest options.

Note: Invalid inputs to these options can break the PWA and be extremely difficult to debug.

Configuration Default Type
pwa_name project variable in conf.py String
pwa_short_name None String
pwa_theme_color None String containing HEX color code
pwa_display "standalone" String
pwa_icons MANDATORY [["image location", "sizes"]]
pwa_online_only False Boolean

Caveats

Supported Browsers: Chrome (Desktop & Mobile), Firefox (Mobile), Safari (iOS). Only the standard, non-beta, non-light versions of these browsers are supported.

Supported OSes: Android >= 6. iOS >= 14.2

Installation Time for Offline to Work: It depends on the website, but a 160MB application takes on average 15 minutes to enable offline support. This also changes depending on the device specific implementation.

Cache Timeouts: Whenever the user clears their browser cache, it will purge the assets. It is undetermined at this time if it will retrigger the download of the entire cache. Some users have space saving applications that may interfere with this.

Release files for sphinxext-pwa 0.0.3a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxext-pwa 0.0.3a0
File Size Uploaded
sphinxext-pwa-0.0.3a0.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxext-pwa 0.0.3a0
File Interpreter ABI Platform
sphinxext_pwa-0.0.3a0-py3-none-any.whl Python 3 none any Details

Total release size: 13.1 kB

Release files / sphinxext-pwa-0.0.3a0.tar.gz

Download URL sphinxext-pwa-0.0.3a0.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cdfb5f5d17d3f5ad442d2008f41320d265aabcb0a668c6d7d906da9861e4544d
BLAKE2b-256 checksum
How to use checksums
b2f16f092f086b35eccb6876df98d91f93521101d4259275162930cdb78db4ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release files / sphinxext_pwa-0.0.3a0-py3-none-any.whl

Download URL sphinxext_pwa-0.0.3a0-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54920de08543f56c601d5816002ae54977e5cf34d14134b17989774ad14472e0
BLAKE2b-256 checksum
How to use checksums
202f36c404be557fb1312e0635017fc3b9c8741890d0c27b88c1d9b0caf0c6bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11

Release history Release notifications | RSS feed

This release

0.0.3a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page