Skip to content

Commit

Permalink
Conditional API note (#595)
Browse files Browse the repository at this point in the history
* Conditional API note

* Update api_reference.rst
  • Loading branch information
nwlandry authored Sep 16, 2024
1 parent 5dc6f4f commit a427896
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 8 additions & 2 deletions docs/source/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ XGI is organized into the following subpackages:

.. note::

This page describes release |version| of XGI. Find out more about this release and previous releases in the `release notes <https://github.com/xgi-org/xgi/releases>`_.

.. only:: stable_version

This page describes release |version| of XGI. Find out more about this release and previous releases in the `release notes <https://github.com/xgi-org/xgi/releases>`_.

.. only:: dev_version

This page describes the latest XGI development with features that may not be released yet. To see officially released features, visit the `API reference <https://xgi.readthedocs.io/en/stable/api_reference.html>`_ for the most recent stable version.

.. toctree::
:maxdepth: 2

Expand Down
9 changes: 8 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,12 @@
else:
raise Exception(f"Error: HTTP response {r.status_code}")


rst_epilog = f"""
.. role:: raw-html(raw)
:format: html
.. |release_announcement| replace:: :raw-html:`<a href={release_url}><button type="button" class="version-button">XGI {release_version} released! {release_date}</button></a>`
.. |release_date| replace:: {release_date}
.. |release_version| replace:: {release_version}
"""

today = release_date
Expand Down Expand Up @@ -200,6 +201,12 @@
else:
version_match = "stable"


if version_match == "stable":
tags.add("stable_version")
elif version_match == "dev":
tags.add("dev_version")

# documentation.
html_theme_options = {
"logo": {
Expand Down

0 comments on commit a427896

Please sign in to comment.