Skip to content

Commit c2754d0

Browse files
committed
Update docs files
1 parent debc265 commit c2754d0

2 files changed

Lines changed: 32 additions & 9 deletions

File tree

CHANGELOG.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
1.0.0
2+
-----
3+
4+
:Date: UNRELEASED
5+
6+
* Remove ability to add the warning banner statically
7+
8+
* Make the banner more customizable (all the configs are included in the ``json`` file generated and available from Javascript)
9+
10+
* Rename ``versionwarning_default_admonition_type`` by ``versionwarning_admonition_type``
11+
12+
* Rename ``versionwarning_body_default_selector`` by ``versionwarning_body_selector``
13+
14+
* Remove ``versionwarning_body_extra_selector``
15+
16+
* Refactor the code to avoid potential circular imports
17+
18+
* Filter Read the Docs versions by ``active=True`` when retrieving versions
19+
20+
121
0.2.0
222
-----
323

README.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ How it works?
1818
-------------
1919

2020
When visiting a page in Read the Docs that was built with this extension enabled,
21-
an AJAX request is done to the Read the Docs servers to retrieve all the versions of the project.
21+
an AJAX request is done to the Read the Docs servers to retrieve all the **active versions** of the project.
2222
These versions are compared against the one that we are reading and if it's an old version,
23-
a red *Warning* banner appears at the top of the page.
23+
a *Warning* banner appears at the top of the page.
2424

2525

2626
Examples
@@ -31,13 +31,11 @@ Examples
3131
There is a live example living at Read the Docs:
3232

3333
- `latest`_ version doesn't show any kind of warning banner
34-
- `0.0.1`_ version shows a custom and fixed message added at build time
3534
- `0.0.2`_ version shows a warning banner saying that 0.0.3 is available (at the time of writing this docs)
3635
- `0.0.3`_ version doesn't show any banner since it's the latest version (at the time of writing this docs)
3736

3837

3938
.. _latest: https://sphinx-version-warning-example.readthedocs.io/en/latest/
40-
.. _0.0.1: https://sphinx-version-warning-example.readthedocs.io/en/0.0.1/
4139
.. _0.0.2: https://sphinx-version-warning-example.readthedocs.io/en/0.0.2/
4240
.. _0.0.3: https://sphinx-version-warning-example.readthedocs.io/en/0.0.3/
4341

@@ -57,14 +55,16 @@ Then in your ``conf.py`` you have to add ``versionwarning`` in the ``extensions`
5755
]
5856

5957

60-
Remember to configure the ``version`` of your Sphinx project since it's the key for this to work properly::
58+
Remember to configure the ``versionwarning_project_version`` and ``versionwarning_project_slug`` of your Sphinx project since it's the key for this to work properly::
6159

62-
version = '0.0.1'
60+
versionwarning_project_version = '0.0.1'
61+
versionwarning_project_slug = 'sphinx-version-warning'
6362

6463
.. warning::
6564

66-
If ``READTHEDOCS_VERSION`` variable is defined, the extension will use its value.
67-
Otherwise, ``versionwarning_project_version`` will be used and if it's not defined, ``version`` as last resource.
65+
If you are building your documentation under Read the Docs,
66+
``READTHEDOCS_VERSION`` and ``READTHEDOCS_PROECT`` environment variables will be defined and there is no need to define these variables,
67+
unless you want to override the default values.
6868

6969

7070
Customization
@@ -81,11 +81,14 @@ versionwarning_default_message (string)
8181
versionwarning_messages (dict)
8282
mapping between versions and messages for its banners
8383

84+
versionwarning_message_placeholder (string)
85+
text to be replaced by the version number link from the message
86+
8487
versionwarning_project_slug (string)
8588
slug of the project under Read the Docs (default to ``READTHEDOCS_PROJECT`` environment variable)
8689

8790
versionwarning_project_version (string)
88-
slug of the version for the current documentation (default to ``READTHEDOCS_VERSION`` environment variable or ``version`` variable from ``conf.py``)
91+
slug of the version for the current documentation (default to ``READTHEDOCS_VERSION`` environment variable)
8992

9093
versionwarning_api_url (string)
9194
API URL to retrieve all versions for this project

0 commit comments

Comments
 (0)