mirror of
https://github.com/python/cpython.git
synced 2025-07-31 15:14:22 +00:00
Add a new environment for whole-paragraph (or longer) notes & warnings.
This commit is contained in:
parent
615e2505f0
commit
6ca33771f8
3 changed files with 47 additions and 4 deletions
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue