summaryrefslogtreecommitdiffstats
path: root/docs/source/conf.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind@gmail.com>2018-10-04 11:55:53 +0100
committerCalum Lind <calumlind@gmail.com>2018-10-04 15:53:42 +0100
commit36606fc448050bcc414769a6944145f57369f8b5 (patch)
treea204c1992d72d57e52807c2298a079c78422d145 /docs/source/conf.py
parentc415b097fe281ebdb7a3d461cecbf755ea7486b5 (diff)
downloaddeluge-36606fc448050bcc414769a6944145f57369f8b5.tar.gz
deluge-36606fc448050bcc414769a6944145f57369f8b5.tar.bz2
deluge-36606fc448050bcc414769a6944145f57369f8b5.zip
[Docs] Add markdown support
- Use recommonmark to enable use of markdown files in docs. - Fix theme not specified - Remove unused spelling module. - Cleanup mocking modules in conf so building docs requires only Sphinx. - Simplify tox section, including use of requirements-docs file. Added slimit dependency for sdist-ing deluge package.
Diffstat (limited to 'docs/source/conf.py')
-rw-r--r--docs/source/conf.py40
1 files changed, 30 insertions, 10 deletions
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 76f4a0fbc..d24ccf8db 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -16,6 +16,7 @@ import sys
from datetime import date
import pkg_resources
+from recommonmark.transform import AutoStructify
try:
from ...version import get_version
@@ -59,19 +60,28 @@ class Mock(object):
else:
return Mock()
+ def __add__(self, other):
+ return other
+
def __or__(self, __):
return Mock()
-MOCK_MODULES = [
- 'deluge.ui.gtkui.gtkui',
- 'deluge._libtorrent',
+# Use custom mock as autodoc_mock_imports fails to handle these modules.
+MOCK_MODULES = ['deluge._libtorrent', 'xdg', 'xdg.BaseDirectory']
+
+for mod_name in MOCK_MODULES:
+ sys.modules[mod_name] = Mock()
+
+autodoc_mock_imports = [
+ 'twisted',
+ 'OpenSSL',
+ 'PIL',
'libtorrent',
'psyco',
'pygtk',
'gtk',
'gobject',
- 'gtk.gdk',
'pango',
'cairo',
'pangocairo',
@@ -83,11 +93,13 @@ MOCK_MODULES = [
'pywintypes',
'win32con',
'win32event',
+ 'pytest',
+ 'mock',
+ 'mako',
+ 'zope',
+ 'zope.interface',
]
-for mod_name in MOCK_MODULES:
- sys.modules[mod_name] = Mock()
-
# General configuration
# ---------------------
@@ -104,7 +116,8 @@ extensions = [
templates_path = ['_templates']
# The suffix of source filenames.
-source_suffix = '.rst'
+source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'}
+source_suffix = ['.rst', '.md']
# The master toctree document.
master_doc = 'index'
@@ -160,11 +173,11 @@ pygments_style = 'sphinx'
# Options for HTML output
# -----------------------
-
+html_theme = 'sphinx_rtd_theme'
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
-html_style = 'default.css'
+# html_style = 'default.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -257,3 +270,10 @@ latex_documents = [
# If false, no module index is generated.
# latex_use_modindex = True
+
+
+def setup(app):
+ app.add_config_value(
+ 'recommonmark_config', {'auto_toc_tree_section': 'Contents'}, True
+ )
+ app.add_transform(AutoStructify)