mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-12-22 22:45:09 +01:00
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.
This commit is contained in:
parent
3329d15691
commit
87b096c7f9
1 changed files with 17 additions and 3 deletions
|
@ -11,7 +11,6 @@
|
||||||
#
|
#
|
||||||
# All configuration values have a default; values that are commented out
|
# All configuration values have a default; values that are commented out
|
||||||
# serve to show the default.
|
# serve to show the default.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
|
@ -25,7 +24,7 @@ sys.path.insert(0, os.path.abspath('../..'))
|
||||||
# -- General configuration ------------------------------------------------
|
# -- General configuration ------------------------------------------------
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
# If your documentation needs a minimal Sphinx version, state it here.
|
||||||
#needs_sphinx = '1.0'
|
needs_sphinx = '1.5.4' # fixes issues with autodoc-skip-member and napoleon
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
|
@ -136,7 +135,7 @@ html_logo = 'ptb-logo-orange.png'
|
||||||
# The name of an image file (within the static path) to use as favicon of the
|
# The name of an image file (within the static path) to use as favicon of the
|
||||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||||
# pixels large.
|
# pixels large.
|
||||||
#html_favicon = None
|
html_favicon = 'ptb-logo-orange.ico'
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
@ -289,3 +288,18 @@ texinfo_documents = [
|
||||||
|
|
||||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||||
#texinfo_no_detailmenu = False
|
#texinfo_no_detailmenu = False
|
||||||
|
|
||||||
|
# -- script stuff --------------------------------------------------------
|
||||||
|
|
||||||
|
import inspect
|
||||||
|
|
||||||
|
|
||||||
|
def autodoc_skip_member(app, what, name, obj, skip, options):
|
||||||
|
if inspect.getmodule(obj).__name__.startswith('telegram') and inspect.isfunction(obj):
|
||||||
|
if name.lower() != name:
|
||||||
|
return True
|
||||||
|
# Return None so napoleon can handle it
|
||||||
|
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.connect('autodoc-skip-member', autodoc_skip_member)
|
||||||
|
|
Loading…
Reference in a new issue