Skip to content

Commit 87b096c

Browse files
committed
Only document functions/methods that are 100% lowercase + use favicon
In bot.py we did stuff like sendAudio = send_audio, which made sphinx document both, which led to clutter in our docs.
1 parent 3329d15 commit 87b096c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/source/conf.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
14-
1514
import sys
1615
import os
1716
import shlex
@@ -25,7 +24,7 @@
2524
# -- General configuration ------------------------------------------------
2625

2726
# If your documentation needs a minimal Sphinx version, state it here.
28-
#needs_sphinx = '1.0'
27+
needs_sphinx = '1.5.4' # fixes issues with autodoc-skip-member and napoleon
2928

3029
# Add any Sphinx extension module names here, as strings. They can be
3130
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -136,7 +135,7 @@
136135
# The name of an image file (within the static path) to use as favicon of the
137136
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
138137
# pixels large.
139-
#html_favicon = None
138+
html_favicon = 'ptb-logo-orange.ico'
140139

141140
# Add any paths that contain custom static files (such as style sheets) here,
142141
# relative to this directory. They are copied after the builtin static files,
@@ -289,3 +288,18 @@
289288

290289
# If true, do not generate a @detailmenu in the "Top" node's menu.
291290
#texinfo_no_detailmenu = False
291+
292+
# -- script stuff --------------------------------------------------------
293+
294+
import inspect
295+
296+
297+
def autodoc_skip_member(app, what, name, obj, skip, options):
298+
if inspect.getmodule(obj).__name__.startswith('telegram') and inspect.isfunction(obj):
299+
if name.lower() != name:
300+
return True
301+
# Return None so napoleon can handle it
302+
303+
304+
def setup(app):
305+
app.connect('autodoc-skip-member', autodoc_skip_member)

0 commit comments

Comments
 (0)