Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

fix docs building with recent sphinx: don't use deprecated sphinx options and imports

Mikhail Korobovdc0304fde1b2
diff --git a/docs/_ext/scrapydocs.py b/docs/_ext/scrapydocs.py
index 83b0d2cc6..192123473 100644
--- a/docs/_ext/scrapydocs.py
+++ b/docs/_ext/scrapydocs.py
@@ -1,6 +1,6 @@
from docutils.parsers.rst.roles import set_classes
from docutils import nodes
-from sphinx.util.compat import Directive
+from docutils.parsers.rst import Directive
from sphinx.util.nodes import make_refnode
from operator import itemgetter
@@ -110,24 +110,28 @@ def setup(app):
app.connect('doctree-read', collect_scrapy_settings_refs)
app.connect('doctree-resolved', replace_settingslist_nodes)
+
def source_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
ref = 'https://github.com/scrapy/scrapy/blob/master/' + text
set_classes(options)
node = nodes.reference(rawtext, text, refuri=ref, **options)
return [node], []
+
def issue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
ref = 'https://github.com/scrapy/scrapy/issues/' + text
set_classes(options)
node = nodes.reference(rawtext, 'issue ' + text, refuri=ref, **options)
return [node], []
+
def commit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
ref = 'https://github.com/scrapy/scrapy/commit/' + text
set_classes(options)
node = nodes.reference(rawtext, 'commit ' + text, refuri=ref, **options)
return [node], []
+
def rev_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
ref = 'http://hg.scrapy.org/scrapy/changeset/' + text
set_classes(options)
diff --git a/docs/conf.py b/docs/conf.py
index 007dc2788..594740f39 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -144,10 +144,6 @@ html_static_path = ['_static']
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-html_use_smartypants = True
-
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
diff --git a/docs/requirements.txt b/docs/requirements.txt
index d3dcb97be..8e7611d21 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,2 +1,2 @@
-Sphinx>=1.3
+Sphinx>=1.6
sphinx_rtd_theme
\ No newline at end of file