Просмотр исходного кода

Replace hardcoded Python docs links with intersphinx

Sage Abdullah 4 месяцев назад
Родитель
Сommit
503d1a743a

+ 4 - 0
docs/conf.py

@@ -169,6 +169,10 @@ intersphinx_mapping = {
         "https://docs.djangoproject.com/en/stable/",
         "https://docs.djangoproject.com/en/stable/_objects/",
     ),
+    "python": (
+        "https://docs.python.org/3/",
+        None,
+    ),
     "sphinx": (
         "https://www.sphinx-doc.org/en/master/",
         None,

+ 1 - 1
docs/contributing/developing.md

@@ -10,7 +10,7 @@ You can also set up a cloud development environment that you can work with in a
 
 (Build scripts for other platforms would be very much welcomed - if you create one, please let us know via the [Slack workspace](https://github.com/wagtail/wagtail/wiki/Slack)!)
 
-If you'd prefer to set up all the components manually, read on. These instructions assume that you're familiar with using pip and [virtual environments](https://docs.python.org/3/tutorial/venv.html) to manage Python packages.
+If you'd prefer to set up all the components manually, read on. These instructions assume that you're familiar with using pip and [virtual environments](inv:python#tutorial/venv) to manage Python packages.
 
 ## Setting up the Wagtail codebase
 

+ 1 - 1
docs/extending/admin_views.md

@@ -2,7 +2,7 @@
 
 The most common use for adding custom views to the Wagtail admin is to provide an interface for managing a Django model. Using [](snippets), Wagtail provides ready-made views for listing, creating, and editing Django models with minimal configuration.
 
-For other kinds of admin views that don't fit this pattern, you can write your own Django views and register them as part of the Wagtail admin through [hooks](admin_hooks). In this example, we'll implement a view that displays a calendar for the current year, using [the calendar module](https://docs.python.org/3/library/calendar.html) from Python's standard library.
+For other kinds of admin views that don't fit this pattern, you can write your own Django views and register them as part of the Wagtail admin through [hooks](admin_hooks). In this example, we'll implement a view that displays a calendar for the current year, using [the calendar module](inv:python#library/calendar) from Python's standard library.
 
 ## Defining a view
 

+ 1 - 1
docs/getting_started/quick_install.md

@@ -69,4 +69,4 @@ python3 -m pip install --upgrade pip
 > command not found: python3
 ```
 
-If this error occurs, [the `python3` can be replaced with `py`](https://docs.python.org/3/faq/windows.html#how-do-i-run-a-python-program-under-windows).
+If this error occurs, [the `python3` can be replaced with `py`](inv:python#faq-run-program-under-windows).

+ 2 - 2
docs/getting_started/tutorial.md

@@ -31,7 +31,7 @@ If none of the preceding commands return a version number, or return a version l
 ### Create and activate a virtual environment
 
 This tutorial recommends using a virtual environment, which isolates installed dependencies from other projects.
-This tutorial uses [`venv`](https://docs.python.org/3/tutorial/venv.html), which is packaged with Python 3. On Ubuntu, it may be necessary to run `sudo apt install python3-venv` to install it.
+This tutorial uses [`venv`](inv:python#tutorial/venv), which is packaged with Python 3. On Ubuntu, it may be necessary to run `sudo apt install python3-venv` to install it.
 
 **On Windows** (cmd.exe), run the following commands:
 
@@ -55,7 +55,7 @@ python -m venv mysite/env
 source mysite/env/bin/activate
 ```
 
-**For other shells** see the [`venv` documentation](https://docs.python.org/3/library/venv.html).
+**For other shells** see the [`venv` documentation](inv:python#tutorial/venv).
 
 ```{note}
 If you're using version control such as git, then `mysite` is the directory for your project.

+ 1 - 1
docs/reference/settings.md

@@ -217,7 +217,7 @@ WAGTAIL_DATETIME_FORMAT = '%d.%m.%Y. %H:%M'
 WAGTAIL_TIME_FORMAT = '%H:%M'
 ```
 
-Specifies the date, time, and datetime format to be used in input fields in the Wagtail admin. The format is specified in [Python datetime module syntax](https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior) and must be one of the recognized formats listed in the [`DATE_INPUT_FORMATS`](inv:django#DATE_INPUT_FORMATS), [`TIME_INPUT_FORMATS`](inv:django#TIME_INPUT_FORMATS), or [`DATETIME_INPUT_FORMATS`](inv:django#DATETIME_INPUT_FORMATS) setting respectively.
+Specifies the date, time, and datetime format to be used in input fields in the Wagtail admin. The format is specified in [Python datetime module syntax](inv:python#format-codes) and must be one of the recognized formats listed in the [`DATE_INPUT_FORMATS`](inv:django#DATE_INPUT_FORMATS), [`TIME_INPUT_FORMATS`](inv:django#TIME_INPUT_FORMATS), or [`DATETIME_INPUT_FORMATS`](inv:django#DATETIME_INPUT_FORMATS) setting respectively.
 
 For example, to use US Imperial style date and time format (AM/PM times) in the Wagtail Admin, you'll need to override the Django format for your site's locale.