diff --git a/flang/docs/ReleaseNotes.md b/flang/docs/ReleaseNotes.md index 6a285f829053..24122e7a7758 100644 --- a/flang/docs/ReleaseNotes.md +++ b/flang/docs/ReleaseNotes.md @@ -1,18 +1,18 @@ -# Flang |version| (In-Progress) Release Notes +# Flang {{version}} {{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 {{version}}. 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 2ccf5472ee23..b607e9a93842 100644 --- a/flang/docs/ReleaseNotesTemplate.txt +++ b/flang/docs/ReleaseNotesTemplate.txt @@ -1,18 +1,18 @@ -# Flang |version| (In-Progress) Release Notes +# Flang {{version}} {{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 {{version}}. 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 0942dbf70ff1..6395834a736c 100644 --- a/flang/docs/conf.py +++ b/flang/docs/conf.py @@ -10,6 +10,7 @@ # serve to show the default. from datetime import date + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -46,6 +47,14 @@ source_suffix = { } 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 ""} + import sphinx # The encoding of source files. @@ -268,3 +277,22 @@ texinfo_documents = [ # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' + + +# This can be treated as its own sphinx extension. setup() will be called by +# sphinx. In it, register a function to be called when the configuration has +# been initialized. The configuration will contain the values of the -D options +# passed to sphinx-build on the command line. +# +# See llvm/cmake/modules/AddSphinxTarget.cmake for details on how sphinx-build +# is invoked. +def setup(app): + app.connect("config-inited", myst_substitutions_update) + + +# Override the myst_parser substitutions map after the configuration has been +# initialized. +def myst_substitutions_update(app, config): + config.myst_substitutions.update( + {"release": config.release, "version": config.version} + )