summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Gordon <jogo@pinterest.com>2023-02-03 08:50:27 -0800
committerJoe Gordon <jogo@pinterest.com>2023-02-03 08:50:27 -0800
commite7161f5fbea1ba8c5a8069bb28558da4e9623e87 (patch)
treef0e0076fdfec75597c3263ed2566b322e001da5f
parent7c3678730dc34afab57b836a9b6f164593aef5c7 (diff)
downloadpymemcache-e7161f5fbea1ba8c5a8069bb28558da4e9623e87.tar.gz
Make sure __init__ functions are displayed in docs
By default autodocs only show class docstrings and hide __init__ https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options Make sure docstrings added to __init__ functions show up in the docs
-rw-r--r--docs/conf.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/conf.py b/docs/conf.py
index c78990a..4b2f3d4 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -17,8 +17,8 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
-import sys
import subprocess
+import sys
sys.path.insert(0, os.path.abspath(".."))
@@ -355,6 +355,12 @@ texinfo_documents = [
intersphinx_mapping = {"https://docs.python.org/": None}
+# autodoc include __init__
+autodoc_default_options = {
+ "special-members": "__init__",
+}
+
+
# Automate building apidoc when building with readthedocs
apidoc_module_dir = os.path.join("..", "pymemcache")
apidoc_output_dir = "apidoc"