Skip to content

Commit

Permalink
Fix earlier versions' links in make_api_rst.py (#150)
Browse files Browse the repository at this point in the history
* Fix earlier versions' links in make_api_rst.py

* Update scripts/make_api_rst.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Denis Rouzaud <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 16, 2024
1 parent ab39b98 commit f74624a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/make_api_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ def ltr_tag(v):

current_stable = cfg["current_stable"]
current_ltr = cfg["current_ltr"]
current_stable_minor = int(current_stable.split(".")[1]) + 2 # '3.38' => 40
current_ltr_minor = int(current_ltr.split(".")[1]) + 2 # '3.38' => 40
current_stable_minor = int(current_stable.split(".")[1])
current_ltr_minor = int(current_ltr.split(".")[1])
old_versions_links = ", ".join(
reversed(
[
f"`3.{v} <https://github.com/qgis/pyqgis-api-docs-builder/releases/download/3.{v}/pyqgis-docs-3.{v}.zip>`_"
for v in range(0, current_stable_minor, 2)
if v not in (current_stable_minor, current_ltr_minor)
if v != current_ltr_minor
]
)
)
Expand All @@ -78,7 +78,6 @@ def ltr_tag(v):
r"""^(?:([\w.]+::)?([\w.]+\.)?(\w+)\s*(?:\((.*)\)(?:\s*->\s*([\w.]+(?:\[.*?\])?))?(?:\s*\[(signal)\])?)?)?$"""
)


# Make sure :numbered: is only specified in the top level index - see
# sphinx docs about this.
document_header = f"""
Expand Down

0 comments on commit f74624a

Please sign in to comment.