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.5.tar.gz (4.8 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.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_algolia_crawler-1.0.5.tar.gz.

File metadata

  • Download URL: sphinx_algolia_crawler-1.0.5.tar.gz
  • Upload date:
  • Size: 4.8 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.5.tar.gz
Algorithm Hash digest
SHA256 85c05d39d12b6e7635146d965e5542fdb766cbf62535402d9987fdccbaa02acc
MD5 d32a37ce4b87c5369aebafea5de71ef7
BLAKE2b-256 440564c6f63051cd22e25e00534ba1ed31e2c352a86b1b0d68b7ee2452a0790b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sphinx_algolia_crawler-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b25d8aee5c3bece68a67e509bc30685bde962f7ff0eb0fa54b3c17c9f700e70c
MD5 146d4568872cc4255b00d6913cb56f8b
BLAKE2b-256 6639a63c7257a6b9330a24542c5d74952cd0aec0bb75cef79a5a06614ca2e12a

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