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

Skip to content

Commit da94374

Browse files
committed
\seemodule: Fix so that each \seemodule entry gets its own paragraph,
so they don't get run together when there's no blank line between them in the source. The HTML conversion already did the right thing. \refmodule: Refer to a module, using a hyperlink in the PDF version. Visually the same as \module.
1 parent 2581704 commit da94374

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Doc/texinputs/python.sty

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@
228228
\newcommand{\refexmodindex}[1]{\py@refmodule{#1}{extension }}
229229
\newcommand{\refstmodindex}[1]{\py@refmodule{#1}{standard }}
230230

231+
% Refer to a module's documentation using a hyperlink of the module's
232+
% name, at least if we're building PDF:
233+
\@ifundefined{pdfannotlink}{%
234+
\newcommand{\refmodule}[2][\py@modulebadkey]{\module{#2}}
235+
}{\newcommand{\refmodule}[2][\py@modulebadkey]{%
236+
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
237+
{\pdfannotlink attr{/Border [0 0 0]} goto name{label-module-\py@modulekey}%
238+
\py@LinkColor\module{#2}\py@NormalColor%
239+
\pdfendlink%
240+
}%
241+
}
242+
}
243+
231244
% support for the module index
232245
\newif\ifpy@UseModuleIndex
233246
\py@UseModuleIndexfalse
@@ -784,12 +797,14 @@
784797

785798
\@ifundefined{pdfannotlink}{%
786799
\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
800+
\par%
787801
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
788802
\ref{module-\py@modulekey}:\quad %
789803
Module \module{#2}%
790804
\quad (#3)%
791805
}
792806
}{\newcommand{\py@seemodule}[3][\py@modulebadkey]{%
807+
\par%
793808
\ifx\py@modulebadkey#1\def\py@modulekey{#2}\else\def\py@modulekey{#1}\fi%
794809
\ref{module-\py@modulekey}:\quad %
795810
{\pdfannotlink attr{/Border [0 0 0]} goto name{label-module-\py@modulekey}%

0 commit comments

Comments
 (0)