Skip to content

Commit e80c529

Browse files
committed
[docs] Remove hard-coded version numbers from sphinx configs
This updates all the non-runtime project release notes to use the version number from CMake instead of the hard-coded version numbers in conf.py. It also hides warnings about pre-releases when the git suffix is dropped from the LLVM version in CMake. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D112181
1 parent 76f37d4 commit e80c529

File tree

11 files changed

+71
-87
lines changed

11 files changed

+71
-87
lines changed

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
====================================================
2-
Extra Clang Tools 14.0.0 (In-Progress) Release Notes
2+
Extra Clang Tools |release| |ReleaseNotesTitle|
33
====================================================
44

55
.. contents::
@@ -8,17 +8,18 @@ Extra Clang Tools 14.0.0 (In-Progress) Release Notes
88

99
Written by the `LLVM Team <https://llvm.org/>`_
1010

11-
.. warning::
11+
.. only:: PreRelease
1212

13-
These are in-progress notes for the upcoming Extra Clang Tools 14 release.
14-
Release notes for previous releases can be found on
15-
`the Download Page <https://releases.llvm.org/download.html>`_.
13+
.. warning::
14+
These are in-progress notes for the upcoming Extra Clang Tools |version| release.
15+
Release notes for previous releases can be found on
16+
`the Download Page <https://releases.llvm.org/download.html>`_.
1617

1718
Introduction
1819
============
1920

2021
This document contains the release notes for the Extra Clang Tools, part of the
21-
Clang release 14.0.0. Here we describe the status of the Extra Clang Tools in
22+
Clang release |release|. Here we describe the status of the Extra Clang Tools in
2223
some detail, including major improvements from the previous release and new
2324
feature work. All LLVM releases may be downloaded from the `LLVM releases web
2425
site <https://llvm.org/releases/>`_.
@@ -32,8 +33,8 @@ main Clang web page, this document applies to the *next* release, not
3233
the current one. To see the release notes for a specific release, please
3334
see the `releases page <https://llvm.org/releases/>`_.
3435

35-
What's New in Extra Clang Tools 14.0.0?
36-
=======================================
36+
What's New in Extra Clang Tools |release|?
37+
==========================================
3738

3839
Some of the major new features and improvements to Extra Clang Tools are listed
3940
here. Generic improvements to Extra Clang Tools as a whole or to its underlying

clang-tools-extra/docs/conf.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@
4444
project = u'Extra Clang Tools'
4545
copyright = u'2007-%d, The Clang Team' % date.today().year
4646

47-
# The version info for the project you're documenting, acts as replacement for
48-
# |version| and |release|, also used in various other places throughout the
49-
# built documents.
50-
#
51-
# The short version.
52-
version = '14'
53-
# The full version, including alpha/beta/rc tags.
54-
release = '14'
55-
5647
# The language for content autogenerated by Sphinx. Refer to documentation
5748
# for a list of supported languages.
5849
#language = None
@@ -87,6 +78,11 @@
8778
# A list of ignored prefixes for module index sorting.
8879
#modindex_common_prefix = []
8980

81+
in_progress_title = "(In-Progress) " if tags.has("PreRelease") else ""
82+
83+
rst_epilog = f"""
84+
.. |ReleaseNotesTitle| replace:: {in_progress_title} Release Notes
85+
"""
9086

9187
# -- Options for HTML output ---------------------------------------------------
9288

clang/docs/ReleaseNotes.rst

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
========================================
2-
Clang 14.0.0 (In-Progress) Release Notes
3-
========================================
1+
===========================================
2+
Clang |release| |ReleaseNotesTitle|
3+
===========================================
44

55
.. contents::
66
:local:
77
:depth: 2
88

99
Written by the `LLVM Team <https://llvm.org/>`_
1010

11-
.. warning::
11+
.. only:: PreRelease
1212

13-
These are in-progress notes for the upcoming Clang 14 release.
14-
Release notes for previous releases can be found on
15-
`the Download Page <https://releases.llvm.org/download.html>`_.
13+
.. warning::
14+
These are in-progress notes for the upcoming Clang |version| release.
15+
Release notes for previous releases can be found on
16+
`the Download Page <https://releases.llvm.org/download.html>`_.
1617

1718
Introduction
1819
============
1920

2021
This document contains the release notes for the Clang C/C++/Objective-C
21-
frontend, part of the LLVM Compiler Infrastructure, release 14.0.0. Here we
22+
frontend, part of the LLVM Compiler Infrastructure, release |release|. Here we
2223
describe the status of Clang in some detail, including major
2324
improvements from the previous release and new feature work. For the
2425
general LLVM release notes, see `the LLVM
@@ -35,8 +36,8 @@ main Clang web page, this document applies to the *next* release, not
3536
the current one. To see the release notes for a specific release, please
3637
see the `releases page <https://llvm.org/releases/>`_.
3738

38-
What's New in Clang 14.0.0?
39-
===========================
39+
What's New in Clang |release|?
40+
==============================
4041

4142
Some of the major new features and improvements to Clang are listed
4243
here. Generic improvements to Clang as a whole or to its underlying

clang/docs/conf.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@
6262
project = u'Clang'
6363
copyright = u'2007-%d, The Clang Team' % date.today().year
6464

65-
# The version info for the project you're documenting, acts as replacement for
66-
# |version| and |release|, also used in various other places throughout the
67-
# built documents.
68-
#
69-
# The short version.
70-
version = '13'
71-
# The full version, including alpha/beta/rc tags.
72-
release = '13'
73-
7465
# The language for content autogenerated by Sphinx. Refer to documentation
7566
# for a list of supported languages.
7667
#language = None
@@ -105,6 +96,11 @@
10596
# A list of ignored prefixes for module index sorting.
10697
#modindex_common_prefix = []
10798

99+
in_progress_title = "(In-Progress) " if tags.has("PreRelease") else ""
100+
101+
rst_epilog = f"""
102+
.. |ReleaseNotesTitle| replace:: {in_progress_title} Release Notes
103+
"""
108104

109105
# -- Options for HTML output ---------------------------------------------------
110106

lld/docs/ReleaseNotes.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
========================
2-
lld 14.0.0 Release Notes
3-
========================
1+
===========================
2+
lld |release| Release Notes
3+
===========================
44

55
.. contents::
66
:local:
77

8-
.. warning::
9-
These are in-progress notes for the upcoming LLVM 14.0.0 release.
10-
Release notes for previous releases can be found on
11-
`the Download Page <https://releases.llvm.org/download.html>`_.
8+
.. only:: PreRelease
9+
10+
.. warning::
11+
These are in-progress notes for the upcoming LLVM |release| release.
12+
Release notes for previous releases can be found on
13+
`the Download Page <https://releases.llvm.org/download.html>`_.
1214

1315
Introduction
1416
============
1517

16-
This document contains the release notes for the lld linker, release 14.0.0.
18+
This document contains the release notes for the lld linker, release |release|.
1719
Here we describe the status of lld, including major improvements
1820
from the previous release. All lld releases may be downloaded
1921
from the `LLVM releases web site <https://llvm.org/releases/>`_.

lld/docs/conf.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@
4343
project = u'lld'
4444
copyright = u'2011-%d, LLVM Project' % date.today().year
4545

46-
# The version info for the project you're documenting, acts as replacement for
47-
# |version| and |release|, also used in various other places throughout the
48-
# built documents.
49-
#
50-
# The short version.
51-
version = '14'
52-
# The full version, including alpha/beta/rc tags.
53-
release = '14'
54-
5546
# The language for content autogenerated by Sphinx. Refer to documentation
5647
# for a list of supported languages.
5748
#language = None

llvm/cmake/modules/AddSphinxTarget.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@ function (add_sphinx_target builder project)
3939
set(ARG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
4040
endif()
4141

42+
if ("${LLVM_VERSION_SUFFIX}" STREQUAL "git")
43+
set(PreReleaseTag "-tPreRelease")
44+
endif()
45+
4246
add_custom_target(${SPHINX_TARGET_NAME}
4347
COMMAND ${CMAKE_COMMAND} -E env ${ARG_ENV_VARS}
4448
${SPHINX_EXECUTABLE}
4549
-b ${builder}
4650
-d "${SPHINX_DOC_TREE_DIR}"
4751
-q # Quiet: no output other than errors and warnings.
4852
-t builder-${builder} # tag for builder
53+
-D version=${LLVM_VERSION_MAJOR}
54+
-D release=${PACKAGE_VERSION}
55+
${PreReleaseTag}
4956
${SPHINX_WARNINGS_AS_ERRORS_FLAG} # Treat warnings as errors if requested
5057
"${ARG_SOURCE_DIR}" # Source
5158
"${SPHINX_BUILD_DIR}" # Output

llvm/docs/ReleaseNotes.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
=========================
2-
LLVM 14.0.0 Release Notes
3-
=========================
1+
============================
2+
LLVM |release| Release Notes
3+
============================
44

55
.. contents::
66
:local:
77

8-
.. warning::
9-
These are in-progress notes for the upcoming LLVM 14 release.
10-
Release notes for previous releases can be found on
11-
`the Download Page <https://releases.llvm.org/download.html>`_.
8+
.. only:: PreRelease
9+
10+
.. warning::
11+
These are in-progress notes for the upcoming LLVM |version| release.
12+
Release notes for previous releases can be found on
13+
`the Download Page <https://releases.llvm.org/download.html>`_.
1214

1315

1416
Introduction
1517
============
1618

1719
This document contains the release notes for the LLVM Compiler Infrastructure,
18-
release 14.0.0. Here we describe the status of LLVM, including major improvements
20+
release |release|. Here we describe the status of LLVM, including major improvements
1921
from the previous release, improvements in various subprojects of LLVM, and
2022
some of the current users of the code. All LLVM releases may be downloaded
2123
from the `LLVM releases web site <https://llvm.org/releases/>`_.

llvm/docs/conf.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@
6161
project = u'LLVM'
6262
copyright = u'2003-%d, LLVM Project' % date.today().year
6363

64-
# The version info for the project you're documenting, acts as replacement for
65-
# |version| and |release|, also used in various other places throughout the
66-
# built documents.
67-
#
68-
# The short version.
69-
version = '13'
70-
# The full version, including alpha/beta/rc tags.
71-
release = '13'
72-
7364
# The language for content autogenerated by Sphinx. Refer to documentation
7465
# for a list of supported languages.
7566
#language = None

polly/docs/ReleaseNotes.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
=============================
2-
Release Notes 14.0 (upcoming)
3-
=============================
1+
===========================================
2+
Release Notes |release| |ReleaseNotesTitle|
3+
===========================================
44

5-
In Polly 14 the following important changes have been incorporated.
5+
In Polly |version| the following important changes have been incorporated.
66

7-
.. warning::
7+
.. only:: PreRelease
88

9-
These release notes are for the next release of Polly and describe
10-
the new features that have recently been committed to our development
11-
branch.
9+
.. warning::
10+
These release notes are for the next release of Polly and describe
11+
the new features that have recently been committed to our development
12+
branch.
1213

1314
- The command line option -polly-opt-fusion has been removed. What the
1415
flag does was frequently misunderstood and is rarely useful. However,

polly/docs/conf.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,6 @@
4444
project = u'Polly'
4545
copyright = u'2010-%d, The Polly Team' % date.today().year
4646

47-
# The version info for the project you're documenting, acts as replacement for
48-
# |version| and |release|, also used in various other places throughout the
49-
# built documents.
50-
#
51-
# The short X.Y version.
52-
version = '14.0-devel'
53-
# The full version, including alpha/beta/rc tags.
54-
release = '14.0-devel'
55-
5647
# The language for content autogenerated by Sphinx. Refer to documentation
5748
# for a list of supported languages.
5849
#language = None
@@ -87,6 +78,11 @@
8778
# A list of ignored prefixes for module index sorting.
8879
#modindex_common_prefix = []
8980

81+
in_progress_title = "(In-Progress) " if tags.has("PreRelease") else ""
82+
83+
rst_epilog = f"""
84+
.. |ReleaseNotesTitle| replace:: {in_progress_title} Release Notes
85+
"""
9086

9187
# -- Options for HTML output ---------------------------------------------------
9288

0 commit comments

Comments
 (0)