]> granicus.if.org Git - python/commitdiff
\seetitle: New macro for building reference list content.
authorFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 17:52:33 +0000 (17:52 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 12 Sep 2000 17:52:33 +0000 (17:52 +0000)
Doc/doc/doc.tex
Doc/perl/python.perl
Doc/texinputs/python.sty

index a834ab39671dabd1e6ced7657b85bc38d4545050..449bb8b9eba1bbae59527f1493cf72a55e0f22b5 100644 (file)
@@ -803,10 +803,10 @@ distribution, to create or maintain whole documents or sections.
       markup used to describe individual references.
     \end{envdesc}
 
-    For each of the following macros, \var{why} should be a complete
-    sentence, start with a capital letter (unless it starts with an
-    identifier, which should not be modified), and end with the
-    apropriate punctuation.
+    For each of the following macros, \var{why} should be one or more
+    complete sentences, starting with a capital letter (unless it
+    starts with an identifier, which should not be modified), and
+    ending with the apropriate punctuation.
 
     \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}}
       Refer to another module.  \var{why} should be a brief
@@ -844,6 +844,13 @@ distribution, to create or maintain whole documents or sections.
       complete sentences.
     \end{macrodesc}
 
+    \begin{macrodesc}{seetitle}{\op{url}\p{title}\p{why}}
+      Add a reference to an external document named \var{title}.  If
+      \var{url} is given, the title is made a hyperlink in the HTML
+      version of the documentation, and displayed below the title in
+      the typeset versions of the documentation.
+    \end{macrodesc}
+
     \begin{macrodesc}{seeurl}{\p{url}\p{why}}
       References to specific on-line resources should be given using
       the \macro{seeurl} macro.  No title is associated with the
index f457715596c0e3c6bf7eeaec2098e057f1af3596..58a4a889845d68d8a41f1a3108dd0eb2b3ad7608 100644 (file)
@@ -1444,6 +1444,25 @@ sub do_cmd_seerfc{
     return handle_rfclike_reference(@_[0], "RFC");
 }
 
+sub do_cmd_seetitle{
+    local($_) = @_;
+    my $url = next_optional_argument();
+    my $title = next_argument();
+    my $text = next_argument();
+    if ($url) {
+        return '<dl compact class="seetitle">'
+          . "\n    <dt><em class=\"citetitle\"><a href=\"$url\""
+          . "\n        class=\"url\">$title</a></em>"
+          . "\n    <dd>$text\n  </dl>"
+          . $_;
+    }
+    return '<dl compact class="seetitle">'
+      . "\n    <dt><em class=\"citetitle\""
+      . "\n        >$title</em>"
+      . "\n    <dd>$text\n  </dl>"
+      . $_;
+}
+
 sub do_cmd_seeurl{
     local($_) = @_;
     my $url = next_argument();
index 40c870bbf9e6101938270252d6a0c97d55da07a0..fe5db27ba9f91609f1af6ecf5d81edccad655ff7 100644 (file)
     \end{fulllineitems}
   }
 }
+% \seetitle[url]{title}{why it's interesting}
+\newcommand{\py@seetitle}[3][\py@modulebadkey]{%
+  \par
+  \begin{fulllineitems}
+    \item[\citetitle{#2}]
+    \ifx\py@modulebadkey#1\else
+      \item[{\small{(\url{#1})}}]
+    \fi
+    #3
+  \end{fulllineitems}
+}
 % \seepep{number}{title}{why it's interesting}
 \newcommand{\py@seepep}[3]{%
   \par%
   \strong{See Also:}\par
   \def\seetext##1{\par{##1}}
   \let\seemodule=\py@seemodule
+  \let\seepep=\py@seepep
   \let\seerfc=\py@seerfc
+  \let\seetitle=\py@seetitle
   \let\seeurl=\py@seeurl
 }{\par}