diff options
author | Fred Drake <fdrake@acm.org> | 2001-04-10 17:13:39 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-04-10 17:13:39 (GMT) |
commit | 86333606f66b2de906a7e9c20322718c0acd14ca (patch) | |
tree | a2d9bb1747fd66932990c30f128f0c72a82a2cfe /Doc | |
parent | b5309a956e93b127f42141eb99c4b09ab9e89a44 (diff) | |
download | cpython-86333606f66b2de906a7e9c20322718c0acd14ca.zip cpython-86333606f66b2de906a7e9c20322718c0acd14ca.tar.gz cpython-86333606f66b2de906a7e9c20322718c0acd14ca.tar.bz2 |
Add corresponding support for the alltt environment to the HTML generator.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/perl/howto.perl | 2 | ||||
-rw-r--r-- | Doc/perl/manual.perl | 2 | ||||
-rw-r--r-- | Doc/perl/python.perl | 46 |
3 files changed, 48 insertions, 2 deletions
diff --git a/Doc/perl/howto.perl b/Doc/perl/howto.perl index 42f722f..76791eb 100644 --- a/Doc/perl/howto.perl +++ b/Doc/perl/howto.perl @@ -6,7 +6,7 @@ package main; do_require_package("article"); -#do_require_package("verbatim"); +do_require_package("alltt"); do_require_package("python"); 1; # sheesh.... diff --git a/Doc/perl/manual.perl b/Doc/perl/manual.perl index b1de916..ea65b36 100644 --- a/Doc/perl/manual.perl +++ b/Doc/perl/manual.perl @@ -9,7 +9,7 @@ package main; do_require_package("report"); -#do_require_package("verbatim"); +do_require_package("alltt"); do_require_package("python"); 1; # sheesh.... diff --git a/Doc/perl/python.perl b/Doc/perl/python.perl index a0cd507..98a1dcf 100644 --- a/Doc/perl/python.perl +++ b/Doc/perl/python.perl @@ -1593,4 +1593,50 @@ withsubitem # {} # {} _RAW_ARG_DEFERRED_CMDS_ +$alltt_start = '<dl><dd><pre class="verbatim">'; +$alltt_end = '</pre></dl>'; + +sub do_env_alltt { + local ($_) = @_; + local($closures,$reopens,@open_block_tags); + + # get the tag-strings for all open tags + local(@keep_open_tags) = @$open_tags_R; + ($closures,$reopens) = &preserve_open_tags() if (@$open_tags_R); + + # get the tags for text-level tags only + $open_tags_R = [ @keep_open_tags ]; + local($local_closures, $local_reopens); + ($local_closures, $local_reopens,@open_block_tags) + = &preserve_open_block_tags + if (@$open_tags_R); + + $open_tags_R = [ @open_block_tags ]; + + do { + local($open_tags_R) = [ @open_block_tags ]; + local(@save_open_tags) = (); + + local($cnt) = ++$global{'max_id'}; + $_ = join('',"$O$cnt$C\\tt$O", ++$global{'max_id'}, $C + , $_ , $O, $global{'max_id'}, "$C$O$cnt$C"); + + $_ = &translate_environments($_); + $_ = &translate_commands($_) if (/\\/); + + # preserve space-runs, using + while (s/(\S) ( +)/$1$2;SPMnbsp;/g){}; + s/(<BR>) /$1;SPMnbsp;/g; + + $_ = join('', $closures, $alltt_start, $local_reopens + , $_ + , &balance_tags() #, $local_closures + , $alltt_end, $reopens); + undef $open_tags_R; undef @save_open_tags; + }; + $open_tags_R = [ @keep_open_tags ]; + $_; +} + + 1; # This must be the last line |