@@ -18,9 +18,9 @@ How it works?
1818-------------
1919
2020When 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.
2222These 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
2626Examples
@@ -31,13 +31,11 @@ Examples
3131There 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
7070Customization
@@ -81,11 +81,14 @@ versionwarning_default_message (string)
8181versionwarning_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+
8487versionwarning_project_slug (string)
8588 slug of the project under Read the Docs (default to ``READTHEDOCS_PROJECT `` environment variable)
8689
8790versionwarning_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
9093versionwarning_api_url (string)
9194 API URL to retrieve all versions for this project
0 commit comments