Skip to main content

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

PyPI PyPI - License

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).

See Algolia Crawler API Doc

Sphinx Setup

Set RTD Env

In ReadTheDocs' env var dashboard, set:

  1. ALGOLIA_CRAWLER_USER_ID
  2. ALGOLIA_CRAWLER_API_KEY
  3. ALGOLIA_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__.py is required for both external pathing and to treat the directory as a pkg

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_algolia_crawler-1.0.6.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_algolia_crawler-1.0.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

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

Hashes for sphinx_algolia_crawler-1.0.6.tar.gz
Algorithm Hash digest
SHA256 ea49f5d0fb8b2a044bca8ac966ef137f4384281026d607d27931978b9fd8aa7b
MD5 da53c0b09bc2d6222df0ba0957ee6a30
BLAKE2b-256 5d2842acf9507084245c4b4e0d6b8c09299cee66b28dc04f7695e8a55311e339

See more details on using hashes here.

File details

Details for the file sphinx_algolia_crawler-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_algolia_crawler-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 57b37f26b6aa6c76bbb85dfba41283d452404bf9df7e339c2c30a677ad0c9901
MD5 728a3000f277fb6bcc25773106b4d079
BLAKE2b-256 05acd38b030c8ba17b9c86c8d4f8815ebd2186be3cc047cc833b92ddec996a79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page