Sphinx Comments

0.0.3 · active · verified Thu Apr 16

Sphinx Comments is a lightweight Sphinx extension that adds comments and annotation functionality to your Sphinx documentation websites. It currently supports integration with popular commenting engines such as Hypothes.is, utteranc.es, and dokie.li. The library is currently at version 0.0.3, with an irregular release cadence that primarily reflects updates to supported commenting platforms or minor Sphinx compatibility adjustments.

Common errors

Warnings

Install

Imports

Quickstart

To quickly integrate sphinx-comments, first install it via pip. Then, modify your Sphinx project's `conf.py` file to include 'sphinx_comments' in the `extensions` list. Finally, define a `comments_config` dictionary, choosing and configuring your desired commenting engine (e.g., Hypothes.is or utteranc.es) according to the library's documentation. Ensure to replace placeholder values like 'your-github-org/your-github-repo' if using utteranc.es.

import os
import sys

# conf.py

# Basic project information
project = 'My Commented Docs'
copyright = '2026, My Organization'
author = 'Doc Creator'

# Add 'sphinx_comments' to your extensions list
extensions = [
    'sphinx.ext.autodoc', # A commonly used Sphinx extension
    'sphinx_comments',
]

# Configure the commenting engine. Choose one and provide its configuration.
# Example 1: Activate Hypothes.is
comments_config = {
   "hypothesis": True
}

# Example 2: Activate utteranc.es (requires a GitHub repository for issues)
# comments_config = {
#    "utterances": {
#        "repo": "your-github-org/your-github-repo", # REQUIRED: Replace with your repo
#        "issue-term": "pathname", # or 'url', 'title', 'og:title'
#        "theme": "github-light", # or 'github-dark', 'preferred-color-scheme', etc.
#        "label": "discussion", # Optional: label for new issues
#    }
# }

# Example 3: Activate dokie.li (experimental)
# comments_config = {
#    "dokieli": True
# }

# Set your desired HTML theme
html_theme = 'alabaster'

view raw JSON →