Add fediverse comments to your sphinx page
Project description
For more of my work, please see my home page.
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 |
|
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
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_fediverse-0.8.0.tar.gz.
File metadata
- Download URL: sphinx_fediverse-0.8.0.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf1366933da98192f102c3b0a860a62f97e4fe8ed5430b2ea1ba73ff483fa8dc
|
|
| MD5 |
e238deb7fc1eaa1e3f022fe06a2cf816
|
|
| BLAKE2b-256 |
439be1510d9aee3dd0b67c56eab9dc87c9f3ce22acd15f617e8b9343724ac588
|
File details
Details for the file sphinx_fediverse-0.8.0-py3-none-any.whl.
File metadata
- Download URL: sphinx_fediverse-0.8.0-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5cda2d9e94eea4481053d4cb51e70b317feec7891dbcb15769ab7b0471c0d0a
|
|
| MD5 |
29dfc3c1f871a3878861c2daf89f7132
|
|
| BLAKE2b-256 |
e468c3bd52a96c4e2ac115a459df18e9725d606aaf1369036d7b7286346e6ac5
|