From 80c69d68addef99f8b6ea5d3ec894752a06e2a9c Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 24 Mar 2020 05:52:07 +0530 Subject: [PATCH] [docs] refactor python docs links using intersphinx --- docs/intro/tutorial.rst | 5 ++--- docs/topics/coroutines.rst | 5 ++--- docs/topics/downloader-middleware.rst | 4 +++- docs/topics/dynamic-content.rst | 10 ++++++---- docs/topics/exporters.rst | 4 ++-- docs/topics/extensions.rst | 2 +- docs/topics/items.rst | 18 ++++++++---------- docs/topics/logging.rst | 10 ++++------ docs/topics/request-response.rst | 14 ++++++-------- docs/topics/settings.rst | 18 +++++++----------- 10 files changed, 41 insertions(+), 49 deletions(-) diff --git a/docs/intro/tutorial.rst b/docs/intro/tutorial.rst index ab6fd4829..5f35dc936 100644 --- a/docs/intro/tutorial.rst +++ b/docs/intro/tutorial.rst @@ -287,8 +287,8 @@ to be scraped, you can at least get **some** data. Besides the :meth:`~scrapy.selector.SelectorList.getall` and :meth:`~scrapy.selector.SelectorList.get` methods, you can also use -the :meth:`~scrapy.selector.SelectorList.re` method to extract using `regular -expressions`_: +the :meth:`~scrapy.selector.SelectorList.re` method to extract using +:doc:`regular expressions `: >>> response.css('title::text').re(r'Quotes.*') ['Quotes to Scrape'] @@ -305,7 +305,6 @@ with a selector (see :ref:`topics-developer-tools`). `Selector Gadget`_ is also a nice tool to quickly find CSS selector for visually selected elements, which works in many browsers. -.. _regular expressions: https://docs.python.org/3/library/re.html .. _Selector Gadget: https://selectorgadget.com/ diff --git a/docs/topics/coroutines.rst b/docs/topics/coroutines.rst index 487cf4c6c..5f61d6796 100644 --- a/docs/topics/coroutines.rst +++ b/docs/topics/coroutines.rst @@ -76,8 +76,8 @@ becomes:: Coroutines may be used to call asynchronous code. This includes other coroutines, functions that return Deferreds and functions that return -`awaitable objects`_ such as :class:`~asyncio.Future`. This means you can use -many useful Python libraries providing such code:: +:term:`awaitable objects ` such as :class:`~asyncio.Future`. +This means you can use many useful Python libraries providing such code:: class MySpider(Spider): # ... @@ -107,4 +107,3 @@ Common use cases for asynchronous code include: :ref:`the screenshot pipeline example`). .. _aio-libs: https://github.com/aio-libs -.. _awaitable objects: https://docs.python.org/3/glossary.html#term-awaitable diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst index d7ec53bfa..d309bbc49 100644 --- a/docs/topics/downloader-middleware.rst +++ b/docs/topics/downloader-middleware.rst @@ -980,7 +980,7 @@ RobotsTxtMiddleware Scrapy ships with support for the following robots.txt_ parsers: * :ref:`Protego ` (default) - * :class:`~urllib.robotparser.RobotFileParser` + * :ref:`RobotFileParser ` * :ref:`Reppy ` * :ref:`Robotexclusionrulesparser ` @@ -1028,6 +1028,8 @@ Based on `Protego `_: Scrapy uses this parser by default. +.. _python-robotfileparser: + RobotFileParser ~~~~~~~~~~~~~~~ diff --git a/docs/topics/dynamic-content.rst b/docs/topics/dynamic-content.rst index 22bcac268..a3f0d6ebb 100644 --- a/docs/topics/dynamic-content.rst +++ b/docs/topics/dynamic-content.rst @@ -130,8 +130,9 @@ data from it depends on the type of response: - If the response is JavaScript, or HTML with a ``