Python API
- sphinx_fediverse.version: str = '1.0.0-alpha'
The package version as a string
- sphinx_fediverse.__version__: Tuple[int, int, int, Unpack[Tuple[int | str, ...]]] = (1, 0, 0, 'alpha')
The package version as a parsed tuple
- sphinx_fediverse.SUPPORTED_FLAVORS: Set[str] = {'mastodon', 'misskey'}
The set of supported fediverse implementations
- sphinx_fediverse.registered_docs: Set[str] = {'index'}
The set of docs currently registered
- sphinx_fediverse.registered_flavors: Set[str] = {}
The set of implementations currently registered
- class sphinx_fediverse.FediverseCommentDirective(*args: Any, **kwargs: Any)
Bases:
SphinxDirective
The directive implementation that adds the comment sections.
- __init__(*args: Any, **kwargs: Any) None
- run() List[nodes.raw]
Main method to execute the directive.
- create_post_if_needed(post_url: str) str
Check if a post exists for this URL. If not, create one.
- process_post(post_url: str, title: str) str
Post a new comment on the Fediverse and return the post ID.
- process_mastodon(post_url: str, title: str) str
Implementation of
process_post()
for Mastodon.Warning
Hard depends on Mastodon.py
- process_misskey(post_url: str, title: str) str
Implementation of
process_post()
for Mastodon.Warning
Hard depends on Misskey.py
- __module__ = 'sphinx_fediverse'
- sphinx_fediverse.on_builder_inited(app: Sphinx) None
Ensure that static files needed for this library are put into the website’s static dir.
- sphinx_fediverse.setup(app: Sphinx) Dict[str, str | bool]
Register the directive, the builder init function, and the configuration options.