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

Skip to content

Commit 4844998

Browse files
committed
\seetitle: New macro for building reference list content.
1 parent 1349437 commit 4844998

3 files changed

Lines changed: 43 additions & 4 deletions

File tree

Doc/doc/doc.tex

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,10 +803,10 @@ \section{\module{bar.foo} ---
803803
markup used to describe individual references.
804804
\end{envdesc}
805805

806-
For each of the following macros, \var{why} should be a complete
807-
sentence, start with a capital letter (unless it starts with an
808-
identifier, which should not be modified), and end with the
809-
apropriate punctuation.
806+
For each of the following macros, \var{why} should be one or more
807+
complete sentences, starting with a capital letter (unless it
808+
starts with an identifier, which should not be modified), and
809+
ending with the apropriate punctuation.
810810

811811
\begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}}
812812
Refer to another module. \var{why} should be a brief
@@ -844,6 +844,13 @@ \section{\module{bar.foo} ---
844844
complete sentences.
845845
\end{macrodesc}
846846

847+
\begin{macrodesc}{seetitle}{\op{url}\p{title}\p{why}}
848+
Add a reference to an external document named \var{title}. If
849+
\var{url} is given, the title is made a hyperlink in the HTML
850+
version of the documentation, and displayed below the title in
851+
the typeset versions of the documentation.
852+
\end{macrodesc}
853+
847854
\begin{macrodesc}{seeurl}{\p{url}\p{why}}
848855
References to specific on-line resources should be given using
849856
the \macro{seeurl} macro. No title is associated with the

Doc/perl/python.perl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,6 +1444,25 @@ sub do_cmd_seerfc{
14441444
return handle_rfclike_reference(@_[0], "RFC");
14451445
}
14461446

1447+
sub do_cmd_seetitle{
1448+
local($_) = @_;
1449+
my $url = next_optional_argument();
1450+
my $title = next_argument();
1451+
my $text = next_argument();
1452+
if ($url) {
1453+
return '<dl compact class="seetitle">'
1454+
. "\n <dt><em class=\"citetitle\"><a href=\"$url\""
1455+
. "\n class=\"url\">$title</a></em>"
1456+
. "\n <dd>$text\n </dl>"
1457+
. $_;
1458+
}
1459+
return '<dl compact class="seetitle">'
1460+
. "\n <dt><em class=\"citetitle\""
1461+
. "\n >$title</em>"
1462+
. "\n <dd>$text\n </dl>"
1463+
. $_;
1464+
}
1465+
14471466
sub do_cmd_seeurl{
14481467
local($_) = @_;
14491468
my $url = next_argument();

Doc/texinputs/python.sty

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,17 @@
922922
\end{fulllineitems}
923923
}
924924
}
925+
% \seetitle[url]{title}{why it's interesting}
926+
\newcommand{\py@seetitle}[3][\py@modulebadkey]{%
927+
\par
928+
\begin{fulllineitems}
929+
\item[\citetitle{#2}]
930+
\ifx\py@modulebadkey#1\else
931+
\item[{\small{(\url{#1})}}]
932+
\fi
933+
#3
934+
\end{fulllineitems}
935+
}
925936
% \seepep{number}{title}{why it's interesting}
926937
\newcommand{\py@seepep}[3]{%
927938
\par%
@@ -951,7 +962,9 @@
951962
\strong{See Also:}\par
952963
\def\seetext##1{\par{##1}}
953964
\let\seemodule=\py@seemodule
965+
\let\seepep=\py@seepep
954966
\let\seerfc=\py@seerfc
967+
\let\seetitle=\py@seetitle
955968
\let\seeurl=\py@seeurl
956969
}{\par}
957970

0 commit comments

Comments
 (0)