Mercurial > cpython-lru_cache-weakref
comparison Doc/perl/python.perl @ 17581:c1937faabb23 2.1
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.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Wed, 18 Apr 2001 17:29:14 +0000 |
| parents | c2fb2d476bd3 |
| children | f63f749364ef |
comparison
equal
deleted
inserted
replaced
| 17580:c657a3937902 | 17581:c1937faabb23 |
|---|---|
| 342 . "<b>Deprecated since release $release.</b>" | 342 . "<b>Deprecated since release $release.</b>" |
| 343 . "\n$reason</div><p>" | 343 . "\n$reason</div><p>" |
| 344 . $_); | 344 . $_); |
| 345 } | 345 } |
| 346 | 346 |
| 347 sub do_cmd_versionadded{ | 347 sub versionnote{ |
| 348 # one parameter: \versionadded{version} | 348 # one or two parameters: \versionnote[explanation]{version} |
| 349 local($_) = @_; | 349 my $type = @_[0]; |
| 350 my $release = next_argument(); | 350 local $_ = @_[1]; |
| 351 return ("\n<span class='versionnote'>New in version $release.</span>\n" | |
| 352 . $_); | |
| 353 } | |
| 354 | |
| 355 sub do_cmd_versionchanged{ | |
| 356 # one parameter: \versionchanged{version} | |
| 357 local($_) = @_; | |
| 358 my $explanation = next_optional_argument(); | 351 my $explanation = next_optional_argument(); |
| 359 my $release = next_argument(); | 352 my $release = next_argument(); |
| 360 my $text = "Changed in version $release."; | 353 my $text = "$type in version $release."; |
| 361 if ($explanation) { | 354 if ($explanation) { |
| 362 $text = "Changed in version $release:\n$explanation."; | 355 $text = "$type in version $release:\n$explanation."; |
| 363 } | 356 } |
| 364 return "\n<span class='versionnote'>$text</span>\n" . $_; | 357 return "\n<span class='versionnote'>$text</span>\n" . $_; |
| 358 } | |
| 359 | |
| 360 sub do_cmd_versionadded{ | |
| 361 return versionnote('New', @_); | |
| 362 } | |
| 363 | |
| 364 sub do_cmd_versionchanged{ | |
| 365 return versionnote('Changed', @_); | |
| 365 } | 366 } |
| 366 | 367 |
| 367 # | 368 # |
| 368 # These function handle platform dependency tracking. | 369 # These function handle platform dependency tracking. |
| 369 # | 370 # |
