mirror of https://github.com/python/cpython
Change the look of \seemodule output to fit in better.
This commit is contained in:
parent
03c05a5192
commit
84bd6f3b18
|
@ -1081,12 +1081,16 @@ sub do_cmd_seemodule{
|
||||||
my $key = next_optional_argument();
|
my $key = next_optional_argument();
|
||||||
my $module = next_argument();
|
my $module = next_argument();
|
||||||
my $text = next_argument();
|
my $text = next_argument();
|
||||||
|
my $period = '.';
|
||||||
$key = $module
|
$key = $module
|
||||||
unless $key;
|
unless $key;
|
||||||
return '<div class=seemodule>'
|
if ($text =~ /\.$/) {
|
||||||
. "\n<p>Module <b><tt class=module><a href=\"module-$key.html\">"
|
$period = '';
|
||||||
. "$module</a></tt></b>"
|
}
|
||||||
. " ($text)</p>\n</div>"
|
return '<dl compact class=seemodule>'
|
||||||
|
. "\n <dt>Module <b><tt class=module><a href=\"module-$key.html\">"
|
||||||
|
. "$module</a></tt>:</b>"
|
||||||
|
. "\n <dd>$text$period\n </dl>"
|
||||||
. $_;
|
. $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -821,28 +821,34 @@
|
||||||
% Cross-referencing (AMK, new impl. FLD)
|
% Cross-referencing (AMK, new impl. FLD)
|
||||||
% Sample usage:
|
% Sample usage:
|
||||||
% \begin{seealso}
|
% \begin{seealso}
|
||||||
% \seemodule{rand}{Uniform random number generator}; % Module xref
|
% \seemodule{rand}{Uniform random number generator.}; % Module xref
|
||||||
% \seetext{\emph{Encyclopedia Britannica}}. % Ref to a book
|
% \seetext{\emph{Encyclopedia Britannica}}. % Ref to a book
|
||||||
%
|
%
|
||||||
% % A funky case: module name contains '_'; have to supply an optional key
|
% % A funky case: module name contains '_'; have to supply an optional key
|
||||||
% \seemodule[copyreg]{copy_reg}{pickle interface constructor registration}
|
% \seemodule[copyreg]{copy_reg}{Interface constructor registration for
|
||||||
%
|
% \module{pickle}.}
|
||||||
% \end{seealso}
|
% \end{seealso}
|
||||||
|
%
|
||||||
|
% Note that the last parameter for \seemodule and \seetext should be complete
|
||||||
|
% sentences and be terminated with the proper punctuation.
|
||||||
|
|
||||||
\@ifundefined{pdfannotlink}{%
|
\@ifundefined{pdfannotlink}{%
|
||||||
\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
|
\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
|
||||||
\par%
|
\par%
|
||||||
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
|
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
|
||||||
\ref{module-\py@modulekey}:\quad %
|
\begin{fulllineitems}
|
||||||
Module \module{#2}%
|
\item[Module \module{#2} (section \ref{module-\py@modulekey}):]
|
||||||
\quad (#3)%
|
#3
|
||||||
|
\end{fulllineitems}
|
||||||
}
|
}
|
||||||
}{\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
|
}{\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
|
||||||
\par%
|
\par%
|
||||||
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
|
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
|
||||||
\ref{module-\py@modulekey}:\quad %
|
\begin{fulllineitems}
|
||||||
\py@linkToName{label-module-\py@modulekey}{ Module \module{#2} }
|
\item[\py@linkToName{label-module-\py@modulekey}{Module \module{#2}}
|
||||||
\quad (#3)%
|
(section \ref{module-\py@modulekey}):]
|
||||||
|
#3
|
||||||
|
\end{fulllineitems}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\newenvironment{seealso}[0]{
|
\newenvironment{seealso}[0]{
|
||||||
|
|
Loading…
Reference in New Issue