Skip to content

Commit

Permalink
Add support for Sphinx 1.4
Browse files Browse the repository at this point in the history
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.
```
  • Loading branch information
redapple committed Mar 30, 2016
1 parent 2664238 commit 38b0908
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/_ext/scrapydocs.py
Expand Up @@ -18,7 +18,7 @@ def is_setting_index(node):
if node.tagname == 'index':
# index entries for setting directives look like:
# [(u'pair', u'SETTING_NAME; setting', u'std:setting-SETTING_NAME', '')]
entry_type, info, refid, _ = node['entries'][0]
entry_type, info, refid = node['entries'][0][:3]
return entry_type == 'pair' and info.endswith('; setting')
return False

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

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


Expand Down
4 changes: 4 additions & 0 deletions docs/topics/selectors.rst
Expand Up @@ -738,10 +738,14 @@ simple/convenient XPaths. You can use the

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

.. highlight:: sh

First, we open the shell with the url we want to scrape::

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

.. highlight:: python

Once in the shell we can try selecting all ``<link>`` objects and see that it
doesn't work (because the Atom XML namespace is obfuscating those nodes)::

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Expand Up @@ -59,6 +59,7 @@ deps = {[testenv:py33]deps}
changedir = docs
deps =
Sphinx
sphinx_rtd_theme

[testenv:docs]
changedir = {[docs]changedir}
Expand Down

0 comments on commit 38b0908

Please sign in to comment.