summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-04-18 03:11:04 (GMT)
committerFred Drake <fdrake@acm.org>2001-04-18 03:11:04 (GMT)
commitc2b29d0fee7e7506ce53e55e55cd2bf0dadedc0b (patch)
treef2bc79152c52461737b67f9a148d9481c0c795af /Doc
parentfdfb05bb0b49d860eb035d779b0ae56e5ca875ed (diff)
downloadcpython-c2b29d0fee7e7506ce53e55e55cd2bf0dadedc0b.zip
cpython-c2b29d0fee7e7506ce53e55e55cd2bf0dadedc0b.tar.gz
cpython-c2b29d0fee7e7506ce53e55e55cd2bf0dadedc0b.tar.bz2
Added support for optional explanation parameter to the \versionadded
macro. Refactored do_cmd_versionadded() and do_cmd_versionchanged() to do most of the work in a helper function, with the do_cmd_*() wrappers just supplying a portion of the replacement text.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/perl/python.perl27
1 files changed, 14 insertions, 13 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index 20615cc..4674f90 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -344,26 +344,27 @@ sub do_cmd_deprecated{
. $_);
}
-sub do_cmd_versionadded{
- # one parameter: \versionadded{version}
- local($_) = @_;
- my $release = next_argument();
- return ("\n<span class='versionnote'>New in version $release.</span>\n"
- . $_);
-}
-
-sub do_cmd_versionchanged{
- # one parameter: \versionchanged{version}
- local($_) = @_;
+sub versionnote{
+ # one or two parameters: \versionnote[explanation]{version}
+ my $type = @_[0];
+ local $_ = @_[1];
my $explanation = next_optional_argument();
my $release = next_argument();
- my $text = "Changed in version $release.";
+ my $text = "$type in version $release.";
if ($explanation) {
- $text = "Changed in version $release:\n$explanation.";
+ $text = "$type in version $release:\n$explanation.";
}
return "\n<span class='versionnote'>$text</span>\n" . $_;
}
+sub do_cmd_versionadded{
+ return versionnote('New', @_);
+}
+
+sub do_cmd_versionchanged{
+ return versionnote('Changed', @_);
+}
+
#
# These function handle platform dependency tracking.
#