Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af2b714

Browse files
committed
\shortversion,
\setshortversion: New markup to help deal with Python having a "real" version number and an abbreviated version number used to create pathnames to the library installation.
1 parent 1fe3b82 commit af2b714

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

Doc/doc/doc.tex

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ \section{Special Markup Constructs}
236236
macros. This section contains the reference material for these
237237
facilities.
238238

239+
\subsection{Markup for the Preamble \label{preamble-info}}
240+
241+
\begin{macrodesc}{release}{\p{ver}}
242+
Set the version number for the software described in the
243+
document.
244+
\end{macrodesc}
245+
246+
\begin{macrodesc}{setshortversion}{\p{sver}}
247+
Specify the ``short'' version number of the documented software
248+
to be \var{sver}.
249+
\end{macrodesc}
250+
239251
\subsection{Meta-information Markup \label{meta-info}}
240252

241253
\begin{macrodesc}{sectionauthor}{\p{author}\p{email}}
@@ -567,6 +579,17 @@ \section{Special Markup Constructs}
567579
acceptable.
568580
\end{macrodesc}
569581

582+
\begin{macrodesc}{shortversion}{}
583+
The ``short'' version number of the documented software, as
584+
specified using the \macro{setshortversion} macro in the
585+
preamble. For Python, the short version number for a release is
586+
the first three characters of the \code{sys.version} value. For
587+
example, versions 2.0b1 and 2.0.1 both have a short version of
588+
2.0. This may not apply for all packages; if
589+
\macro{setshortversion} is not used, this produces an empty
590+
expansion. See also the \macro{version} macro.
591+
\end{macrodesc}
592+
570593
\begin{macrodesc}{strong}{\p{text}}
571594
Strongly emphasized text; this will be presented using a bold
572595
font.
@@ -588,8 +611,9 @@ \section{Special Markup Constructs}
588611
\end{macrodesc}
589612

590613
\begin{macrodesc}{version}{}
591-
The version number for the documentation, as specified using
592-
\macro{release} in the preamble.
614+
The version number of the described software, as specified using
615+
\macro{release} in the preamble. See also the
616+
\macro{shortversion} macro.
593617
\end{macrodesc}
594618

595619
\begin{macrodesc}{versionadded}{\p{version}}

Doc/texinputs/python.sty

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,13 @@
975975
%
976976
\newcommand{\py@release}{}
977977
\newcommand{\version}{}
978+
\newcommand{\shortversion}{}
978979
\newcommand{\releasename}{Release}
979980
\newcommand{\release}[1]{%
980981
\renewcommand{\py@release}{\releasename\space\version}%
981982
\renewcommand{\version}{#1}}
983+
\newcommand{\setshortversion}[1]{%
984+
\renewcommand{\shortversion}{#1}}
982985

983986
% Allow specification of the author's address separately from the
984987
% author's name. This can be used to format them differently, which

0 commit comments

Comments
 (0)