@@ -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,22 +55,24 @@ 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
7171-------------
7272
7373Some customization can be done using the ``conf.py `` file of your Sphinx project:
7474
75- versionwarning_default_admonition_type (string)
75+ versionwarning_admonition_type (string)
7676 type of admonition for the banner (warning, admonition or note)
7777
7878versionwarning_default_message (string)
@@ -88,7 +88,7 @@ versionwarning_project_slug (string)
8888 slug of the project under Read the Docs (default to ``READTHEDOCS_PROJECT `` environment variable)
8989
9090versionwarning_project_version (string)
91- 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)
9292
9393versionwarning_api_url (string)
9494 API URL to retrieve all versions for this project
@@ -99,11 +99,8 @@ versionwarning_banner_html (string)
9999versionwarning_banner_id_div (string)
100100 HTML element ID used for the <div> inject as banner
101101
102- versionwarning_body_default_selector (string)
103- jQuery selector to find the body element in the page
104-
105- versionwarning_body_extra_selector (string)
106- jQuery selector to find the body element in the page if ``versionwarning_body_default_selector `` wasn't found
102+ versionwarning_body_selector (string)
103+ jQuery selector to find the body element in the page and *prepend * the banner
107104
108105
109106How to contribute?
0 commit comments