This Sphinx extension uses Algolia's v1 Crawler API - and may even be run standalone via CLI (without Sphinx).
Project description
Sphinx Extension: Sphinx Algolia Crawler
Description
This Sphinx extension (that can also be run standalone) uses Algolia's v1 Crawler API
to trigger a crawl. RTD uses Production stage, but Dev stage can be triggered either
via standalone Python CLI call or by setting project root .env (see .env.template).
Sphinx Setup
Set RTD Env
In ReadTheDocs' env var dashboard, set:
ALGOLIA_CRAWLER_USER_IDALGOLIA_CRAWLER_API_KEYALGOLIA_CRAWLER_ID
💡 Add this to your root proj .env to test locally (or as a standalone Python app)
conf.py
import sys, os
sys.path.append(os.path.abspath(os.path.join('_extensions', 'sphinx_algolia_crawler')))
extensions = [ 'sphinx_algolia_crawler' ]
# While this example merely turns it on, you probably want to check if RTD /latest production
# See `xbe_docs` `conf.py` for examples of how we checked for this
algolia_crawler_enabled = True
Usage
Standalone
See the -h (help) command:
python3 .\sphinx_algolia_crawler.py -h
Sphinx Ext
If conf.py setup is set and algolia_crawler_enabled, this will automatically trigger when the build is done.
Requirements
- Python>=3.6
- Sphinx>=1.8
This may work with older versions, but has not been tested.
Entry Points
At sphinx_algolia_crawler.py:
Sphinx Extension
See setup(app) definition.
Standalone
See if is_standalone: block.
Tested in
- Windows 11 via PowerShell 7
- Ubuntu 22.04 WSL2 Shell
- ReadTheDocs (RTD) CI Deployment (Ubuntu 22.04)
Notes
__init__.pyis required for both external pathing and to treat the directory as a pkg
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_algolia_crawler-1.0.6.tar.gz.
File metadata
- Download URL: sphinx_algolia_crawler-1.0.6.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea49f5d0fb8b2a044bca8ac966ef137f4384281026d607d27931978b9fd8aa7b
|
|
| MD5 |
da53c0b09bc2d6222df0ba0957ee6a30
|
|
| BLAKE2b-256 |
5d2842acf9507084245c4b4e0d6b8c09299cee66b28dc04f7695e8a55311e339
|
File details
Details for the file sphinx_algolia_crawler-1.0.6-py3-none-any.whl.
File metadata
- Download URL: sphinx_algolia_crawler-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57b37f26b6aa6c76bbb85dfba41283d452404bf9df7e339c2c30a677ad0c9901
|
|
| MD5 |
728a3000f277fb6bcc25773106b4d079
|
|
| BLAKE2b-256 |
05acd38b030c8ba17b9c86c8d4f8815ebd2186be3cc047cc833b92ddec996a79
|