From b0d40ea22cf2a88e8418dd2c20e7b4f0b3ed6f8b Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Mon, 23 Feb 2015 04:20:35 +0000 Subject: [PATCH] Closes #1735: Use https://doc.python.org/ instead of ``http`` protocol. It was used for `sphinx.ext.intersphinx` and some documentation. --- CHANGES | 2 ++ EXAMPLES | 2 +- doc/_templates/index.html | 2 +- doc/conf.py | 2 +- doc/config.rst | 2 +- doc/ext/intersphinx.rst | 8 ++++---- doc/theming.rst | 2 +- doc/tutorial.rst | 4 ++-- sphinx/ext/napoleon/iterators.py | 2 +- sphinx/quickstart.py | 2 +- tests/test_ext_intersphinx.py | 12 ++++++------ 11 files changed, 21 insertions(+), 19 deletions(-) diff --git a/CHANGES b/CHANGES index 53eda4c02..09f541860 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,8 @@ Incompatible changes * Dependency requirement updates: docutils 0.11, Pygments 2.0 * The ``gettext_enables`` config value has been renamed to `gettext_additional_targets`. +* #1735: Use https://doc.python.org/ instead of ``http`` protocol. + It was used for `sphinx.ext.intersphinx` and some documentation. Features added -------------- diff --git a/EXAMPLES b/EXAMPLES index 1b5093137..cad113bfd 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -53,7 +53,7 @@ Documentation using the default theme * PyPubSub: http://pubsub.sourceforge.net/ * pyrticle: http://documen.tician.de/pyrticle/ * pySPACE: http://pyspace.github.io/pyspace/ -* Python: http://docs.python.org/ +* Python: https://docs.python.org/ * python-apt: http://apt.alioth.debian.org/python-apt-doc/ * PyUblas: http://documen.tician.de/pyublas/ * Quex: http://quex.sourceforge.net/doc/html/main.html diff --git a/doc/_templates/index.html b/doc/_templates/index.html index 2016ea9f6..ccef89a78 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -12,7 +12,7 @@

{%trans%} Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license.{%endtrans%}

-

{%trans%}It was originally created for the +

{%trans%}It was originally created for the new Python documentation, and it has excellent facilities for the documentation of Python projects, but C/C++ is already supported as well, and it is planned to add special support for other languages as well. Of diff --git a/doc/conf.py b/doc/conf.py index f391cb5bd..b83ba84da 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -84,7 +84,7 @@ texinfo_documents = [ # We're not using intersphinx right now, but if we did, this would be part of # the mapping: -intersphinx_mapping = {'python': ('http://docs.python.org/2/', None)} +intersphinx_mapping = {'python': ('https://docs.python.org/2/', None)} # Sphinx document translation with sphinx gettext feature uses these settings: locale_dirs = ['locale/'] diff --git a/doc/config.rst b/doc/config.rst index 821be199f..c27c5e644 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -768,7 +768,7 @@ that use Sphinx's HTMLWriter class. output, and all pages will contain a ```` tag referring to it. Since OpenSearch doesn't support relative URLs for its search page location, the value of this option must be the base URL from which these documents are - served (without trailing slash), e.g. ``"http://docs.python.org"``. The + served (without trailing slash), e.g. ``"https://docs.python.org"``. The default is ``''``. .. confval:: html_file_suffix diff --git a/doc/ext/intersphinx.rst b/doc/ext/intersphinx.rst index 7cb4a0a85..785164a0c 100644 --- a/doc/ext/intersphinx.rst +++ b/doc/ext/intersphinx.rst @@ -84,7 +84,7 @@ linking: To add links to modules and objects in the Python standard library documentation, use:: - intersphinx_mapping = {'python': ('http://docs.python.org/3.4', None)} + intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None)} This will download the corresponding :file:`objects.inv` file from the Internet and generate links to the pages under the given URI. The downloaded @@ -94,12 +94,12 @@ linking: A second example, showing the meaning of a non-``None`` value of the second tuple item:: - intersphinx_mapping = {'python': ('http://docs.python.org/3.4', + intersphinx_mapping = {'python': ('https://docs.python.org/3.4', 'python-inv.txt')} This will read the inventory from :file:`python-inv.txt` in the source directory, but still generate links to the pages under - ``http://docs.python.org/3.4``. It is up to you to update the inventory file + ``https://docs.python.org/3.4``. It is up to you to update the inventory file as new objects are added to the Python documentation. **Multiple target for the inventory** @@ -113,7 +113,7 @@ linking: this to specify mirror sites for server downtime of the primary inventory:: - intersphinx_mapping = {'python': ('http://docs.python.org/3.4', + intersphinx_mapping = {'python': ('https://docs.python.org/3.4', (None, 'python-inv.txt'))} .. confval:: intersphinx_cache_limit diff --git a/doc/theming.rst b/doc/theming.rst index 0a2d726dd..86b531828 100644 --- a/doc/theming.rst +++ b/doc/theming.rst @@ -133,7 +133,7 @@ These themes are: include ``px`` in the value.) Defaults to 230 pixels. * **default** -- This is the default theme, which looks like `the Python - documentation `_. It can be customized via these + documentation `_. It can be customized via these options: - **rightsidebar** (true or false): Put the sidebar on the right side. diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 0a12a27a0..95bd61ebc 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -273,7 +273,7 @@ Many Sphinx documents including the `Python documentation`_ are published on the internet. When you want to make links to such documents from your documentation, you can do it with :mod:`sphinx.ext.intersphinx`. -.. _Python documentation: http://docs.python.org/3 +.. _Python documentation: https://docs.python.org/3 In order to use intersphinx, you need to activate it in :file:`conf.py` by putting the string ``'sphinx.ext.intersphinx'`` into the :confval:`extensions` @@ -282,7 +282,7 @@ list and set up the :confval:`intersphinx_mapping` config value. For example, to link to ``io.open()`` in the Python library manual, you need to setup your :confval:`intersphinx_mapping` like:: - intersphinx_mapping = {'python': ('http://docs.python.org/3', None)} + intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} And now, you can write a cross-reference like ``:py:func:`io.open```. Any cross-reference that has no matching target in the current documentation set, diff --git a/sphinx/ext/napoleon/iterators.py b/sphinx/ext/napoleon/iterators.py index 50dd67e57..f59a3f088 100644 --- a/sphinx/ext/napoleon/iterators.py +++ b/sphinx/ext/napoleon/iterators.py @@ -37,7 +37,7 @@ class peek_iter(object): See Also -------- `peek_iter` can operate as a drop in replacement for the built-in - `iter `_ function. + `iter `_ function. Attributes ---------- diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 53b6bef83..0155ec1cc 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -428,7 +428,7 @@ epub_exclude_files = ['search.html'] INTERSPHINX_CONFIG = u''' # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +intersphinx_mapping = {'https://docs.python.org/': None} ''' MASTER_FILE = u'''\ diff --git a/tests/test_ext_intersphinx.py b/tests/test_ext_intersphinx.py index d55973220..427bc87db 100644 --- a/tests/test_ext_intersphinx.py +++ b/tests/test_ext_intersphinx.py @@ -84,8 +84,8 @@ def test_missing_reference(tempdir, app, status, warning): inv_file = tempdir / 'inventory' inv_file.write_bytes(inventory_v2) app.config.intersphinx_mapping = { - 'http://docs.python.org/': inv_file, - 'py3k': ('http://docs.python.org/py3k/', inv_file), + 'https://docs.python.org/': inv_file, + 'py3k': ('https://docs.python.org/py3k/', inv_file), } app.config.intersphinx_cache_limit = 0 @@ -94,7 +94,7 @@ def test_missing_reference(tempdir, app, status, warning): inv = app.env.intersphinx_inventory assert inv['py:module']['module2'] == \ - ('foo', '2.0', 'http://docs.python.org/foo.html#module-module2', '-') + ('foo', '2.0', 'https://docs.python.org/foo.html#module-module2', '-') # create fake nodes and check referencing @@ -115,7 +115,7 @@ def test_missing_reference(tempdir, app, status, warning): # check resolution when a target is found rn = reference_check('py', 'func', 'module1.func', 'foo') assert isinstance(rn, nodes.reference) - assert rn['refuri'] == 'http://docs.python.org/sub/foo.html#module1.func' + assert rn['refuri'] == 'https://docs.python.org/sub/foo.html#module1.func' assert rn['reftitle'] == '(in foo v2.0)' assert rn[0].astext() == 'foo' @@ -164,8 +164,8 @@ def test_load_mappings_warnings(tempdir, app, status, warning): inv_file = tempdir / 'inventory' inv_file.write_bytes(inventory_v2) app.config.intersphinx_mapping = { - 'http://docs.python.org/': inv_file, - 'py3k': ('http://docs.python.org/py3k/', inv_file), + 'https://docs.python.org/': inv_file, + 'py3k': ('https://docs.python.org/py3k/', inv_file), 'repoze.workflow': ('http://docs.repoze.org/workflow/', inv_file), 'django-taggit': ('http://django-taggit.readthedocs.org/en/latest/', inv_file)