Skip to content

Commit 16b5439

Browse files
committed
Mention some sphinx directives
1 parent 23ccd6d commit 16b5439

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

docs/guides/deprecating-content.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@ Deprecating versions
1616

1717
If you have multiple versions of your project,
1818
it makes sense to have its :doc:`documentation versioned </versions>` as well.
19-
For example, if you have the following versions and want to deprecate V1.
19+
For example, if you have the following versions and want to deprecate v1.
2020

21-
- project.readthedocs.io/en/v1/
22-
- project.readthedocs.io/en/v2/
23-
- project.readthedocs.io/en/v3/
21+
- ``https://project.readthedocs.io/en/v1/``
22+
- ``https://project.readthedocs.io/en/v2/``
23+
- ``https://project.readthedocs.io/en/v3/``
2424

2525
For cases like this you can *hide* a version.
2626
Hidden versions won't be listed in the versions menu of your docs,
2727
and they will be listed in a :ref:`robots.txt file <hosting:custom robots.txt pages>`
28-
to stop search engines of showing results for that version::
29-
30-
# project.readthedocs.io/robots.txt
31-
32-
User-agent: *
33-
34-
Disallow: /en/v1/ # Hidden version
28+
to stop search engines of showing results for that version.
3529

3630
Users can still see all versions in the dashboard of your project.
3731
To hide a version go to your project and click on :guilabel:`Versions` > :guilabel:`Edit`,
@@ -50,10 +44,10 @@ Deprecating content
5044
-------------------
5145

5246
You may not always want to deprecate a version, but deprecate some pages.
53-
For example, if you have documentation about two APIs and you want to deprecate V1:
47+
For example, if you have documentation about two APIs and you want to deprecate v1:
5448

55-
- project.readthedocs.io/en/latest/api/v1.html
56-
- project.readthedocs.io/en/latest/api/v2.html
49+
- ``https://project.readthedocs.io/en/latest/api/v1.html``
50+
- ``https://project.readthedocs.io/en/latest/api/v2.html``
5751

5852
A simple way is just adding a warning at the top of the page,
5953
this will warn users visiting that page,
@@ -84,6 +78,13 @@ This wont hide results from that page, but it will give priority to results from
8478

8579
.. TODO: mention search.ignore when it's implemented.
8680
81+
82+
.. tip::
83+
84+
If you are using Sphinx with reStructuredText,
85+
you can make use of some :doc:`directives <sphinx:usage/restructuredtext/directives>`
86+
like ``warning``, ``deprecated``, ``versionchanged`` to warn your users about deprecated content.
87+
8788
Moving and deleting pages
8889
-------------------------
8990

@@ -94,6 +95,6 @@ But be aware that users may have links of that page saved,
9495
and it will be frustrating and confusing for them to get a 404.
9596

9697
To solve that problem you can create a redirect to a page with a similar feature/content,
97-
like redirecting to the docs of the V2 of your API when your users visit the deleted docs from V1,
98+
like redirecting to the docs of the v2 of your API when your users visit the deleted docs from v1,
9899
this is a :ref:`page redirect <user-defined-redirects:page redirects>` from ``/api/v1.html`` to ``/api/v2.html``.
99100
See :doc:`/user-defined-redirects`.

0 commit comments

Comments
 (0)