Skip to content

Commit 6655083

Browse files
tarunprabhuHoney Goyal
authored andcommitted
[flang][docs] Fix title and text 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.
1 parent 248f941 commit 6655083

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed

flang/docs/ReleaseNotes.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<!-- If you want to modify sections/contents permanently, you should modify both
22
ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
33

4-
# Flang |version| (In-Progress) Release Notes
4+
# Flang {{version}} {{in_progress}}Release Notes
55

66
> **warning**
77
>
8-
> These are in-progress notes for the upcoming LLVM |version| release.
8+
> These are in-progress notes for the upcoming LLVM {{version}} release.
99
> Release notes for previous releases can be found on [the Download
1010
> Page](https://releases.llvm.org/download.html).
1111
1212
## Introduction
1313

1414
This document contains the release notes for the Flang Fortran frontend,
15-
part of the LLVM Compiler Infrastructure, release |version|. Here we
15+
part of the LLVM Compiler Infrastructure, release {{version}}. Here we
1616
describe the status of Flang in some detail, including major
1717
improvements from the previous release and new feature work. For the
1818
general LLVM release notes, see [the LLVM
@@ -45,7 +45,6 @@ page](https://llvm.org/releases/).
4545

4646
## New Issues Found
4747

48-
4948
## Additional Information
5049

5150
Flang's documentation is located in the `flang/docs/` directory in the

flang/docs/ReleaseNotesTemplate.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<!-- If you want to modify sections/contents permanently, you should modify both
22
ReleaseNotes.md and ReleaseNotesTemplate.txt. -->
33

4-
# Flang |version| (In-Progress) Release Notes
4+
# Flang {{version}} {{in_progress}}Release Notes
55

66
> **warning**
77
>
8-
> These are in-progress notes for the upcoming LLVM |version| release.
8+
> These are in-progress notes for the upcoming LLVM {{version}} release.
99
> Release notes for previous releases can be found on [the Download
1010
> Page](https://releases.llvm.org/download.html).
1111

1212
## Introduction
1313

1414
This document contains the release notes for the Flang Fortran frontend,
15-
part of the LLVM Compiler Infrastructure, release |version|. Here we
15+
part of the LLVM Compiler Infrastructure, release {{version}}. Here we
1616
describe the status of Flang in some detail, including major
1717
improvements from the previous release and new feature work. For the
1818
general LLVM release notes, see [the LLVM

flang/docs/conf.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# serve to show the default.
1111

1212
from datetime import date
13+
1314
# If extensions (or modules to document with autodoc) are in another directory,
1415
# add these directories to sys.path here. If the directory is relative to the
1516
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -46,6 +47,14 @@
4647
}
4748
myst_heading_anchors = 6
4849

50+
# Enable myst's substitution extension since markdown files cannot use the
51+
# |version| and |release| substitutions available to .rst files.
52+
myst_enable_extensions = ["substitution"]
53+
54+
# The substitutions to use in markdown files. This contains unconditional
55+
# substitutions, but more may be added once the configuration is obtained.
56+
myst_substitutions = {"in_progress": "(In-Progress) " if tags.has("PreRelease") else ""}
57+
4958
import sphinx
5059

5160
# The encoding of source files.
@@ -268,3 +277,22 @@
268277

269278
# How to display URL addresses: 'footnote', 'no', or 'inline'.
270279
# texinfo_show_urls = 'footnote'
280+
281+
282+
# This can be treated as its own sphinx extension. setup() will be called by
283+
# sphinx. In it, register a function to be called when the configuration has
284+
# been initialized. The configuration will contain the values of the -D options
285+
# passed to sphinx-build on the command line.
286+
#
287+
# See llvm/cmake/modules/AddSphinxTarget.cmake for details on how sphinx-build
288+
# is invoked.
289+
def setup(app):
290+
app.connect("config-inited", myst_substitutions_update)
291+
292+
293+
# Override the myst_parser substitutions map after the configuration has been
294+
# initialized.
295+
def myst_substitutions_update(app, config):
296+
config.myst_substitutions.update(
297+
{"release": config.release, "version": config.version}
298+
)

0 commit comments

Comments
 (0)