aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-01-10 00:39:48 -0500
committerRapptz <[email protected]>2016-01-10 00:39:48 -0500
commitc6b31c9663c60d72b64a0e3eab984d48681004a0 (patch)
treef2b8d0dad7b878b8ae1ea48cc4d01e708f7263ee
parentAdd a Whats New page to have a nicer changelog. (diff)
downloaddiscord.py-c6b31c9663c60d72b64a0e3eab984d48681004a0.tar.xz
discord.py-c6b31c9663c60d72b64a0e3eab984d48681004a0.zip
Attempt to satisfy RTD by using sphinxcontrib.napoleon.
-rw-r--r--docs/conf.py10
-rw-r--r--setup.py7
2 files changed, 14 insertions, 3 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 85bdbd89..0d4a84d9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -16,6 +16,8 @@ import sys
import os
import re
+on_rtd = os.getenv('READTHEDOCS') == 'True'
+
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -32,9 +34,13 @@ sys.path.insert(0, os.path.abspath('..'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.extlinks',
- 'sphinx.ext.napoleon',
]
+if on_rtd:
+ extensions.append('sphinxcontrib.napoleon')
+else:
+ extensions.append('sphinx.ext.napoleon')
+
autodoc_member_order = 'bysource'
extlinks = {
@@ -153,7 +159,7 @@ html_theme = 'sphinx_rtd_theme'
# 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,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+# html_static_path = ['_static']
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
diff --git a/setup.py b/setup.py
index 918fa012..5a1f5641 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,15 @@
from setuptools import setup, find_packages
-import re
+import re, os
+
+on_rtd = os.getenv('READTHEDOCS') == 'True'
requirements = []
with open('requirements.txt') as f:
requirements = f.read().splitlines()
+if on_rtd:
+ requirements.append('sphinxcontrib-napoleon')
+
version = ''
with open('discord/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)