summaryrefslogtreecommitdiffstats
path: root/Doc/perl
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-12-14 22:50:06 (GMT)
committerFred Drake <fdrake@acm.org>2001-12-14 22:50:06 (GMT)
commit6ca33771f88e5819a2c8880d6f022d9f8d43faf0 (patch)
treef5aeb060d04c0a972f0bb42f07e856bf891d2d8a /Doc/perl
parent615e2505f032df1de66ed97195a99cce8d054cce (diff)
downloadcpython-6ca33771f88e5819a2c8880d6f022d9f8d43faf0.zip
cpython-6ca33771f88e5819a2c8880d6f022d9f8d43faf0.tar.gz
cpython-6ca33771f88e5819a2c8880d6f022d9f8d43faf0.tar.bz2
Add a new environment for whole-paragraph (or longer) notes & warnings.
Diffstat (limited to 'Doc/perl')
-rw-r--r--Doc/perl/python.perl23
1 files changed, 21 insertions, 2 deletions
diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl
index 036b2ee..3b55139 100644
--- a/Doc/perl/python.perl
+++ b/Doc/perl/python.perl
@@ -236,17 +236,36 @@ sub do_cmd_textbf{
return use_wrappers(@_[0], '<b>', '</b>'); }
sub do_cmd_textit{
return use_wrappers(@_[0], '<i>', '</i>'); }
+# This can be changed/overridden for translations:
+%NoticeNames = ('note' => 'Note:',
+ 'warning' => 'Warning:',
+ );
+
sub do_cmd_note{
+ my $label = $NoticeNames{'note'};
return use_wrappers(
@_[0],
- "<span class=\"note\"><b class=\"label\">Note:</b>\n",
+ "<span class=\"note\"><b class=\"label\">$label</b>\n",
'</span>'); }
sub do_cmd_warning{
+ my $label = $NoticeNames{'warning'};
return use_wrappers(
@_[0],
- "<span class=\"warning\"><b class=\"label\">Warning:</b>\n",
+ "<span class=\"warning\"><b class=\"label\">$label</b>\n",
'</span>'); }
+sub do_env_notice{
+ local($_) = @_;
+ my $notice = next_optional_argument();
+ if (!$notice) {
+ $notice = 'note';
+ }
+ my $label = $NoticeNames{$notice};
+ return ("<div class=\"$notice\"><b class=\"label\">$label</b>\n"
+ . $_
+ . '</div>');
+}
+
sub do_cmd_moreargs{
return '...' . @_[0]; }
sub do_cmd_unspecified{