[flang-commits] [flang] [flang][docs] Fix title and text in the release notes page (PR #170405)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Tue Dec 2 18:38:32 PST 2025


https://github.com/tarunprabhu created https://github.com/llvm/llvm-project/pull/170405

The title of the release notes page always showed "|version| (In-Progress)". This has been fixed so the release version is shown as expected. '(In-Progress)' is now only shown on non-release branches. Unlike clang, flang does not use ${LLVM_VERSION_SUFFIX}, so even on non-release branches the 'git' suffix will not be shown.

----------------------------------------------------------------------
What the notes currently look like:

<img width="972" height="413" alt="flang-broken" src="https://github.com/user-attachments/assets/95602a3d-7292-4521-a5d3-607b19336877" />

What the notes look like after this fix:

<img width="950" height="418" alt="flang-release-fixed" src="https://github.com/user-attachments/assets/b38a05c2-96e6-4a12-a2d8-57becdf8a1d2" />

>From 0f563cc308346551cab48c2491e23a66b5d98a07 Mon Sep 17 00:00:00 2001
From: Tarun Prabhu <tarun at lanl.gov>
Date: Tue, 2 Dec 2025 19:28:32 -0700
Subject: [PATCH] [flang][docs] Fix the title in the release notes page

The title of the release notes page always showed "|version| (In-Progress)".
This has been fixed so the release version is shown as expected. '(In-Progress)'
is now only shown on non-release branches. Unlike clang, flang does not use
${LLVM_VERSION_SUFFIX}, so even on non-release branches the 'git' suffix will
not be shown.
---
 flang/docs/ReleaseNotes.md          |  7 +++----
 flang/docs/ReleaseNotesTemplate.txt |  6 +++---
 flang/docs/conf.py                  | 25 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/flang/docs/ReleaseNotes.md b/flang/docs/ReleaseNotes.md
index 6a285f829053b..858d118578224 100644
--- a/flang/docs/ReleaseNotes.md
+++ b/flang/docs/ReleaseNotes.md
@@ -1,18 +1,18 @@
 <!-- If you want to modify sections/contents permanently, you should modify both
 ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
 
-# Flang |version| (In-Progress) Release Notes
+# Flang {{release}} {{in_progress}}Release Notes
 
 > **warning**
 >
-> These are in-progress notes for the upcoming LLVM |version| release.
+> These are in-progress notes for the upcoming LLVM {{version}} release.
 > Release notes for previous releases can be found on [the Download
 > Page](https://releases.llvm.org/download.html).
 
 ## Introduction
 
 This document contains the release notes for the Flang Fortran frontend,
-part of the LLVM Compiler Infrastructure, release |version|. Here we
+part of the LLVM Compiler Infrastructure, release {{release}}. Here we
 describe the status of Flang in some detail, including major
 improvements from the previous release and new feature work. For the
 general LLVM release notes, see [the LLVM
@@ -45,7 +45,6 @@ page](https://llvm.org/releases/).
 
 ## New Issues Found
 
-
 ## Additional Information
 
 Flang's documentation is located in the `flang/docs/` directory in the
diff --git a/flang/docs/ReleaseNotesTemplate.txt b/flang/docs/ReleaseNotesTemplate.txt
index 2ccf5472ee234..70720d16050fd 100644
--- a/flang/docs/ReleaseNotesTemplate.txt
+++ b/flang/docs/ReleaseNotesTemplate.txt
@@ -1,18 +1,18 @@
 <!-- If you want to modify sections/contents permanently, you should modify both
 ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
 
-# Flang |version| (In-Progress) Release Notes
+# Flang {{release}} {{in_progress}}Release Notes
 
 > **warning**
 >
-> These are in-progress notes for the upcoming LLVM |version| release.
+> These are in-progress notes for the upcoming LLVM {{version}} release.
 > Release notes for previous releases can be found on [the Download
 > Page](https://releases.llvm.org/download.html).
 
 ## Introduction
 
 This document contains the release notes for the Flang Fortran frontend,
-part of the LLVM Compiler Infrastructure, release |version|. Here we
+part of the LLVM Compiler Infrastructure, release {{release}}. Here we
 describe the status of Flang in some detail, including major
 improvements from the previous release and new feature work. For the
 general LLVM release notes, see [the LLVM
diff --git a/flang/docs/conf.py b/flang/docs/conf.py
index 0942dbf70ff16..8980a570d2965 100644
--- a/flang/docs/conf.py
+++ b/flang/docs/conf.py
@@ -46,6 +46,31 @@
 }
 myst_heading_anchors = 6
 
+# Enable myst's substitution extension since markdown files cannot use the
+# |version| and |release| substitutions available to .rst files.
+myst_enable_extensions = [
+    'substitution'
+]
+
+# The substitutions to use in markdown files. This contains unconditional
+# substitutions, but more may be added once the configuration is obtained.
+myst_substitutions = {
+    'in_progress': "(In-Progress) " if tags.has("PreRelease") else ""
+}
+
+# It is not clear who calls setup and when. In any case, when it is called, the
+# configurations options are available. These include, among the other things,
+# the values of the -D options passed to sphinx-build. Populate the myst
+# substitutions dictionary as needed.
+#
+# See llvm/cmake/modules/AddSphinxTarget.cmake for details on how sphinx-build
+# is invoked.
+def setup(sphinx):
+    sphinx.config.myst_substitutions.update({
+        'release': sphinx.config.release,
+        'version': sphinx.config.version
+    })
+
 import sphinx
 
 # The encoding of source files.



More information about the flang-commits mailing list