From f1a808a5025b63715d1034af2b96a6a5241d29e9 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 15 Apr 2020 13:11:13 +0200 Subject: [PATCH] Used :rfc: role in various docs. --- docs/ref/contrib/gis/geos.txt | 4 +--- docs/ref/contrib/syndication.txt | 3 +-- docs/ref/files/uploads.txt | 4 +--- docs/ref/unicode.txt | 10 ++++------ docs/ref/utils.txt | 2 +- docs/topics/conditional-view-processing.txt | 18 +++++++----------- docs/topics/http/sessions.txt | 4 ++-- docs/topics/signing.txt | 8 ++++---- 8 files changed, 21 insertions(+), 32 deletions(-) diff --git a/docs/ref/contrib/gis/geos.txt b/docs/ref/contrib/gis/geos.txt index 536c42f74e..cfb207288f 100644 --- a/docs/ref/contrib/gis/geos.txt +++ b/docs/ref/contrib/gis/geos.txt @@ -212,14 +212,12 @@ Format Input Type WKT / EWKT ``str`` HEX / HEXEWKB ``str`` WKB / EWKB ``buffer`` -GeoJSON_ ``str`` +:rfc:`GeoJSON <7946>` ``str`` ======================= ========== For the GeoJSON format, the SRID is set based on the ``crs`` member. If ``crs`` isn't provided, the SRID defaults to 4326. -.. _GeoJSON: https://tools.ietf.org/html/rfc7946 - .. classmethod:: GEOSGeometry.from_gml(gml_string) Constructs a :class:`GEOSGeometry` from the given GML string. diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index ad41ebd68e..4d2bf806ad 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -7,7 +7,7 @@ The syndication feed framework quite easily. Django comes with a high-level syndication-feed-generating framework for -creating RSS_ and Atom_ feeds. +creating RSS_ and :rfc:`Atom <4287>` feeds. To create any syndication feed, all you have to do is write a short Python class. You can create as many feeds as you want. @@ -17,7 +17,6 @@ you want to generate feeds outside of a Web context, or in some other lower-level way. .. _RSS: http://www.whatisrss.com/ -.. _Atom: https://tools.ietf.org/html/rfc4287 The high-level framework ======================== diff --git a/docs/ref/files/uploads.txt b/docs/ref/files/uploads.txt index cd6cc0df5f..0021800a64 100644 --- a/docs/ref/files/uploads.txt +++ b/docs/ref/files/uploads.txt @@ -61,9 +61,7 @@ Here are some useful attributes of ``UploadedFile``: header. This is typically provided by services, such as Google App Engine, that intercept and handle file uploads on your behalf. As a result your handler may not receive the uploaded file content, but instead a URL or - other pointer to the file. (see `RFC 2388`_ section 5.3). - - .. _RFC 2388: https://www.ietf.org/rfc/rfc2388.txt + other pointer to the file (see :rfc:`RFC 2388 <2388#section-5.3>`). .. attribute:: UploadedFile.charset diff --git a/docs/ref/unicode.txt b/docs/ref/unicode.txt index 2c69d669b0..e980147f49 100644 --- a/docs/ref/unicode.txt +++ b/docs/ref/unicode.txt @@ -143,11 +143,12 @@ from then on, you can treat the result as always being a string. URI and IRI handling ~~~~~~~~~~~~~~~~~~~~ -Web frameworks have to deal with URLs (which are a type of IRI_). One +Web frameworks have to deal with URLs (which are a type of IRI). One requirement of URLs is that they are encoded using only ASCII characters. However, in an international environment, you might need to construct a -URL from an IRI_ -- very loosely speaking, a URI_ that can contain Unicode -characters. Use these functions for quoting and converting an IRI to a URI: +URL from an :rfc:`IRI <3987>` -- very loosely speaking, a :rfc:`URI <2396>` +that can contain Unicode characters. Use these functions for quoting and +converting an IRI to a URI: * The :func:`django.utils.encoding.iri_to_uri()` function, which implements the conversion from IRI to URI as required by :rfc:`3987#section-3.1`. @@ -213,9 +214,6 @@ following is always true:: So you can safely call it multiple times on the same URI/IRI without risking double-quoting problems. -.. _URI: https://www.ietf.org/rfc/rfc2396.txt -.. _IRI: https://www.ietf.org/rfc/rfc3987.txt - Models ====== diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index a9f4107d8c..87c9f43baa 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -464,7 +464,7 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004 .. class:: Atom1Feed(SyndicationFeed) - Spec: https://tools.ietf.org/html/rfc4287 + Spec: :rfc:`4287` ``django.utils.functional`` =========================== diff --git a/docs/topics/conditional-view-processing.txt b/docs/topics/conditional-view-processing.txt index aef77e7a00..d565576a16 100644 --- a/docs/topics/conditional-view-processing.txt +++ b/docs/topics/conditional-view-processing.txt @@ -15,21 +15,17 @@ or you can rely on the :class:`~django.middleware.http.ConditionalGetMiddleware` middleware to set the ``ETag`` header. When the client next requests the same resource, it might send along a header -such as either `If-modified-since`_ or `If-unmodified-since`_, containing the -date of the last modification time it was sent, or either `If-match`_ or -`If-none-match`_, containing the last ``ETag`` it was sent. -If the current version of the page matches the ``ETag`` sent by the client, or -if the resource has not been modified, a 304 status code can be sent back, -instead of a full response, telling the client that nothing has changed. +such as either :rfc:`If-modified-since <7232#section-3.3>` or +:rfc:`If-unmodified-since <7232#section-3.4>`, containing the date of the last +modification time it was sent, or either :rfc:`If-match <7232#section-3.1>` or +:rfc:`If-none-match <7232#section-3.2>`, containing the last ``ETag`` it was +sent. If the current version of the page matches the ``ETag`` sent by the +client, or if the resource has not been modified, a 304 status code can be sent +back, instead of a full response, telling the client that nothing has changed. Depending on the header, if the page has been modified or does not match the ``ETag`` sent by the client, a 412 status code (Precondition Failed) may be returned. -.. _If-match: https://tools.ietf.org/html/rfc7232#section-3.1 -.. _If-none-match: https://tools.ietf.org/html/rfc7232#section-3.2 -.. _If-modified-since: https://tools.ietf.org/html/rfc7232#section-3.3 -.. _If-unmodified-since: https://tools.ietf.org/html/rfc7232#section-3.4 - When you need more fine-grained control you may use per-view conditional processing functions. diff --git a/docs/topics/http/sessions.txt b/docs/topics/http/sessions.txt index 71abe7603e..9427ac0169 100644 --- a/docs/topics/http/sessions.txt +++ b/docs/topics/http/sessions.txt @@ -144,7 +144,8 @@ and the :setting:`SECRET_KEY` setting. tampered with. The same invalidation happens if the client storing the cookie (e.g. your user's browser) can't store all of the session cookie and drops data. Even though Django compresses the data, it's still entirely - possible to exceed the `common limit of 4096 bytes`_ per cookie. + possible to exceed the :rfc:`common limit of 4096 bytes <2965#section-5.3>` + per cookie. **No freshness guarantee** @@ -165,7 +166,6 @@ and the :setting:`SECRET_KEY` setting. Finally, the size of a cookie can have an impact on the `speed of your site`_. -.. _`common limit of 4096 bytes`: https://tools.ietf.org/html/rfc2965#section-5.3 .. _`replay attacks`: https://en.wikipedia.org/wiki/Replay_attack .. _`speed of your site`: https://yuiblog.com/blog/2007/03/01/performance-research-part-3/ diff --git a/docs/topics/signing.txt b/docs/topics/signing.txt index 7927333914..d910a7af52 100644 --- a/docs/topics/signing.txt +++ b/docs/topics/signing.txt @@ -84,10 +84,10 @@ generate signatures. You can use a different secret by passing it to the .. class:: Signer(key=None, sep=':', salt=None, algorithm='sha256') Returns a signer which uses ``key`` to generate signatures and ``sep`` to - separate values. ``sep`` cannot be in the `URL safe base64 alphabet - `_. This alphabet contains - alphanumeric characters, hyphens, and underscores. ``algorithm`` must be an - algorithm supported by :py:mod:`hashlib`. + separate values. ``sep`` cannot be in the :rfc:`URL safe base64 alphabet + <4648#section-5>`. This alphabet contains alphanumeric characters, hyphens, + and underscores. ``algorithm`` must be an algorithm supported by + :py:mod:`hashlib`. .. versionchanged:: 3.1