]> granicus.if.org Git - python/commitdiff
New markup: \note{...} and \warning{...}
authorFred Drake <fdrake@acm.org>
Tue, 9 Oct 2001 18:01:23 +0000 (18:01 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 9 Oct 2001 18:01:23 +0000 (18:01 +0000)
Doc/doc/doc.tex
Doc/perl/python.perl
Doc/texinputs/python.sty
Doc/tools/sgmlconv/conversion.xml

index 85eb3f3c15481c0945d3c939b7bf7fa09bda5804..00a465f0d5c431a9420db3f5231dec4dca0d62bc 100644 (file)
@@ -859,6 +859,14 @@ This \UNIX\ is also followed by a space.
       The name of a Usenet newsgroup.
     \end{macrodesc}
 
+    \begin{macrodesc}{note}{\p{text}}
+      An especially important bit of information about an API that a
+      user should be aware of when using whatever bit of API the
+      note pertains to.  This should be the last thing in the
+      paragraph as the end of the note is not visually marked in
+      any way.
+    \end{macrodesc}
+
     \begin{macrodesc}{pep}{\p{number}}
       A reference to a Python Enhancement Proposal.  This generates
       appropriate index entries.  The text \samp{PEP \var{number}} is
@@ -989,6 +997,15 @@ This \UNIX\ is also followed by a space.
       explanation makes sense and may vary as needed.
     \end{macrodesc}
 
+    \begin{macrodesc}{warning}{\p{text}}
+      An important bit of information about an API that a user should
+      be very aware of when using whatever bit of API the warning
+      pertains to.  This should be the last thing in the paragraph as
+      the end of the warning is not visually marked in any way.  This
+      differs from \macro{note} in that it is recommended over
+      \macro{note} for information regarding security.
+    \end{macrodesc}
+
 
   \subsection{Module-specific Markup \label{module-markup}}
 
index 13e7aac3207e46ef2ca1bc5a01fdd53443db5e35..10dcdd0c00eea2077b63500e0ea4e863f86ffb47 100644 (file)
@@ -236,6 +236,16 @@ sub do_cmd_textbf{
     return use_wrappers(@_[0], '<b>', '</b>'); }
 sub do_cmd_textit{
     return use_wrappers(@_[0], '<i>', '</i>'); }
+sub do_cmd_note{
+    return use_wrappers(
+        @_[0],
+        "<span class=\"note\"><b class=\"label\">Note:</b>\n",
+        '</span>'); }
+sub do_cmd_warning{
+    return use_wrappers(
+        @_[0],
+        "<span class=\"warning\"><b class=\"label\">Warning:</b>\n",
+        '</span>'); }
 
 sub do_cmd_moreargs{
     return '...' . @_[0]; }
index 9fa56cd66ef3857a89056098ae8e203bc30423cd..0244466b4eb18fbf2f64403d9164fae0050f4dfe 100644 (file)
   \end{center}
 }
 
+\newcommand{\note}[1]{\strong{Note:} #1}
+\newcommand{\warning}[1]{\strong{Warning:} #1}
+
 % Deprecation stuff.
 % Should be extended to allow an index / list of deprecated stuff.  But
 % there's a lot of stuff that needs to be done to make that automatable.
index 1944b1f784918d53b5958174ea1021fc5d0390d8..248c9c1ccc6450583bfc357d993c157456f9ad3f 100644 (file)
     <content/>
     </macro>
   <macro name="shortversion"/>
+  <macro name="note">
+    <content/>
+    </macro>
+  <macro name="warning">
+    <content/>
+    </macro>
   <!-- These are broken:  we need to re-order the optional and required
        parameters, making the optional parameter the content for the
        element.  latex2esis.py is not powerful enough to handle this.