Skip to content

Commit

Permalink
Attempt to satisfy RTD by using sphinxcontrib.napoleon.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Jan 10, 2016
1 parent 604e931 commit c6b31c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
10 changes: 8 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
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.
Expand All @@ -32,9 +34,13 @@
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 = {
Expand Down Expand Up @@ -153,7 +159,7 @@
# 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
Expand Down
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit c6b31c9

Please sign in to comment.