Skip to main content

Add fediverse comments to your sphinx page

Project description

For more of my work, please see my home page.

PyPI License PyPI Status PyPI Version PyPI Total Downloads
Open GitHub Issues Open GitHub Pull Requests GitHub Sponsors

Quick Start Guide

Installation

pip install sphinx-fediverse

Configuration

There are a few necessary values that you must provide:

Option

Description

Example

html_baseurl

The host your documentation will be on

https://www.sphinx-doc.org/

fedi_flavor

The API your server implements

'mastodon' or 'misskey'

fedi_username

The username of the account to make posts on

xkcd

fedi_instance

The host you’re making comments on

botsin.space

comments_mapping_file

The name of the comments map file

comments_mapping.json (default)

replace_index_with_slash

True to replace /index.html with /

True (default)

enable_post_creation

True to automatically post, False for manual

True (default)

raise_error_if_no_post

True to raise an error if not post is made

True (default)

We also rely on some environment variables.

For Mastodon instances we require: MASTODON_CLIENT_ID, MASTODON_CLIENT_SECRET, MASTODON_ACCESS_TOKEN.

For Misskey instances we require: MISSKEY_ACCESS_TOKEN.

Each of these must be set if you want to have automatic post creation. They are intentionally not included in the config file so you are incentivized to not store them publicly.

Usage

To use this extension, simply add it to your conf.py’s extension list:

extensions = [
   # ...
   'sphinx_fediverse',
]

And add the following to each page you want a comments section to appear in:

.. fedi-comments::

This will enable a comments section for each post. Upon build, a Mastodon post will be generated for each new page. This will be stored in the same directory as your config file. The ID of each page’s post will be embedded into the output documents, and used to retrieve comments.

Supported Themes

Because this project includes styling, we need to ensure compatibility with each theme individually. To view it in any officially supported theme, click one of the links below:

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_fediverse-0.6.0.tar.gz (26.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_fediverse-0.6.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_fediverse-0.6.0.tar.gz.

File metadata

  • Download URL: sphinx_fediverse-0.6.0.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sphinx_fediverse-0.6.0.tar.gz
Algorithm Hash digest
SHA256 41f0f98f1d70b4283ede95750493619083d5c41e58ebd69ee74602a4fd104c08
MD5 e8360d6b1273f69c1098a41fc1c69324
BLAKE2b-256 4db594bb1c6c3432df9a9035dba90ee9fd66e8c7f3ed89eb5b197a03e951f056

See more details on using hashes here.

File details

Details for the file sphinx_fediverse-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_fediverse-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80c26fc1c75b362c60ccc350c77eb44f57ff2e03d8f20b5e2af70af9f81d4fdf
MD5 7fc3b0d8fd9e02aa2d7ff447b958e04b
BLAKE2b-256 200b5ab09e6316357a5b06037eb094b6f96008b623f48a5e3f5bdc5edab0ad59

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