Skip to content

Commit 38b0908

Browse files
committed
Add support for Sphinx 1.4
See http://www.sphinx-doc.org/en/stable/changes.html#release-1-4-released-mar-28-2016 sphinx_rtd_theme has become optional, needs to be added to reqs sphinx-doc/sphinx#2320 changes node entries tuples to 5 values instead of 4 `sh` syntax highlighting added very locally in selectors.rst because of this warning/error with Sphinx 1.4: ``` Warning, treated as error: /home/paul/src/scrapy/docs/topics/selectors.rst:743: WARNING: Could not lex literal_block as "python". Highlighting skipped. ```
1 parent 2664238 commit 38b0908

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

docs/_ext/scrapydocs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def is_setting_index(node):
1818
if node.tagname == 'index':
1919
# index entries for setting directives look like:
2020
# [(u'pair', u'SETTING_NAME; setting', u'std:setting-SETTING_NAME', '')]
21-
entry_type, info, refid, _ = node['entries'][0]
21+
entry_type, info, refid = node['entries'][0][:3]
2222
return entry_type == 'pair' and info.endswith('; setting')
2323
return False
2424

@@ -30,7 +30,7 @@ def get_setting_target(node):
3030

3131
def get_setting_name_and_refid(node):
3232
"""Extract setting name from directive index node"""
33-
entry_type, info, refid, _ = node['entries'][0]
33+
entry_type, info, refid = node['entries'][0][:3]
3434
return info.replace('; setting', ''), refid
3535

3636

docs/topics/selectors.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,14 @@ simple/convenient XPaths. You can use the
738738

739739
Let's show an example that illustrates this with Github blog atom feed.
740740

741+
.. highlight:: sh
742+
741743
First, we open the shell with the url we want to scrape::
742744

743745
$ scrapy shell https://github.com/blog.atom
744746

747+
.. highlight:: python
748+
745749
Once in the shell we can try selecting all ``<link>`` objects and see that it
746750
doesn't work (because the Atom XML namespace is obfuscating those nodes)::
747751

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ deps = {[testenv:py33]deps}
5959
changedir = docs
6060
deps =
6161
Sphinx
62+
sphinx_rtd_theme
6263

6364
[testenv:docs]
6465
changedir = {[docs]changedir}

0 commit comments

Comments
 (0)