]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
add new reference macro: \seelink
authorFred Drake <fdrake@acm.org>
Thu, 8 Jan 2004 15:00:13 +0000 (15:00 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 8 Jan 2004 15:00:13 +0000 (15:00 +0000)
Doc/doc/doc.tex
Doc/perl/python.perl
Doc/texinputs/python.sty

index 47fd3b522779b35d2353c4140b61002e312914df..2edaadd389ece2df703aa4f8ae1f56baa2ecdbd7 100644 (file)
@@ -1400,6 +1400,15 @@ This \UNIX\ is also followed by a space.
     These macros are only defined within the content of the
     \env{seealso} and \env{seealso*} environments.
 
+    \begin{macrodesc}{seelink}{\p{url}\p{linktext}\p{why}}
+      References to specific on-line resources should be given using
+      the \macro{seelink} macro if they don't have a meaningful title
+      but there is some short description of what's at the end of the
+      link.  Online documents which have identifiable titles should be
+      referenced using the \macro{seetitle} macro, using the optional
+      parameter to that macro to provide the URL.
+    \end{macrodesc}
+
     \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}}
       Refer to another module.  \var{why} should be a brief
       explanation of why the reference may be interesting.  The module
index 7d50e491ef4cbc9b2cb00e676b3c83fe2e43b815..bdf49374e04ed09e61d0d50e92fafab559c481b7 100644 (file)
@@ -1908,6 +1908,19 @@ sub do_cmd_seetitle{
       . $_;
 }
 
+sub do_cmd_seelink{
+    local($_) = @_;
+    my $url = next_argument();
+    my $linktext = next_argument();
+    my $text = next_argument();
+    my $icon = get_link_icon($url);
+    return '<dl compact class="seeurl">'
+      . "\n    <dt><a href='$url'"
+      . "\n        >$linktext$icon</a></dt>"
+      . "\n    <dd>$text</dd>\n  </dl>"
+      . $_;
+}
+
 sub do_cmd_seeurl{
     local($_) = @_;
     my $url = next_argument();
index dba42dd391a1331289119fc2caa1652c103da324..9638b563a999d2bcbfc8ba952a1b9bdbf841f29c 100644 (file)
   }
 \fi
 
+% \seelink{url}{link text}
+\newcommand{\py@seelink}[3]{%
+  \par
+  \begin{fulllineitems}
+    \item[\ulink{#2}{#1}]
+    #3
+  \end{fulllineitems}
+}
 % \seetitle[url]{title}{why it's interesting}
 \newcommand{\py@seetitle}[3][\py@modulebadkey]{%
   \par
   \let\seerfc=\py@seerfc
   \let\seetitle=\py@seetitle
   \let\seeurl=\py@seeurl
+  \let\seelink=\py@seelink
 }{\par}
 \newenvironment{seealso}{
   \par
   \let\seerfc=\py@seerfc
   \let\seetitle=\py@seetitle
   \let\seeurl=\py@seeurl
+  \let\seelink=\py@seelink
 }{\par}
 
 % Allow the Python release number to be specified independently of the