stas 2002/06/13 02:20:16 Modified: lib/DocSet/Doc Common.pm POD2HTML.pm POD2HTMLPS.pm Log: DocSet sync: - implement the splitting of the long E<lt>preE<gt> text only in DocSet::Doc::POD2HTMLPS's view_verbatim, where it's needed. Use the simple view_verbatim() in DocSet::Doc::POD2HTML. Revision Changes Path 1.13 +0 -27 modperl-docs/lib/DocSet/Doc/Common.pm Index: Common.pm =================================================================== RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/Common.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Common.pm 12 Jun 2002 02:53:46 -0000 1.12 +++ Common.pm 13 Jun 2002 09:20:16 -0000 1.13 @@ -145,26 +145,6 @@ return qq{<a name="$anchor" href="#toc_$anchor">$link</a>}; } -# the <pre> section uses class "pre-section", which allows to use a custom -# look-n-feel via the CSS -sub pod_pom_html_view_verbatim { - my ($self, $text) = @_; - for ($text) { - s/&/&/g; - s/</</g; - s/>/>/g; - } - - # if the <pre> section is too long ps2pdf fails to generate pdf, - # so split it into 40 lines chunks. - my $result = ''; - while ($text =~ /((?:[^\n]*\n?){1,40})/sg) { - next unless length($1); # skip empty matches - $result .= qq{<pre class="pre-section">$1</pre>\n}; - } - - return $result; -} @@ -256,13 +236,6 @@ this is a common function that takes the C<$title> Pod::POM object, converts it into a E<lt>a nameE<gt> html anchor and returns it. - -=item * pod_pom_html_view_verbatim - -this is an overloaded C<Pod::POM::HTML::view_verbatim()> method which -renders the E<lt>preE<gt>...E<lt>/preE<gt> html, but embeds a virtual -colored line as the left column, so the rendered text will stand out -from the normal text. =back 1.6 +19 -2 modperl-docs/lib/DocSet/Doc/POD2HTML.pm Index: POD2HTML.pm =================================================================== RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/POD2HTML.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- POD2HTML.pm 29 Apr 2002 17:36:55 -0000 1.5 +++ POD2HTML.pm 13 Jun 2002 09:20:16 -0000 1.6 @@ -136,6 +136,20 @@ return -e $file ? qq{<a href="$path">$path</a>} : qq{<i>$path</i>}; } +# the <pre> section uses class "pre-section", which allows to use a custom +# look-n-feel via the CSS +sub view_verbatim { + my ($self, $text) = @_; + for ($text) { + s/&/&/g; + s/</</g; + s/>/>/g; + } + + return qq{<pre class="pre-section">$text</pre>\n}; +} + + #sub view_for { # my $self = shift; # my ($for) = @_; @@ -150,7 +164,6 @@ #} *anchor = \&DocSet::Doc::Common::pod_pom_html_anchor; -*view_verbatim = \&DocSet::Doc::Common::pod_pom_html_view_verbatim; *view_seq_link_transform_path = \&DocSet::Doc::Common::pod_pom_html_view_seq_link_transform_path; #*view_seq_link = \&DocSet::Doc::Common::pod_pom_html_view_seq_link; @@ -209,7 +222,11 @@ otherwise the default behaviour applies (the file path is turned into italics). -The following rendering methods: view_verbatim(), anchor() and +view_verbatim() is overriden: renders the +E<lt>preE<gt>...E<lt>/preE<gt> html, but defines a CSS class +C<pre-section> so the look-n-feel can be adjusted. + +The following rendering methods: anchor() and view_seq_link_transform_path() are defined in the C<DocSet::Doc::Common> class and documented there. 1.4 +44 -2 modperl-docs/lib/DocSet/Doc/POD2HTMLPS.pm Index: POD2HTMLPS.pm =================================================================== RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/POD2HTMLPS.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- POD2HTMLPS.pm 22 Mar 2002 02:01:51 -0000 1.3 +++ POD2HTMLPS.pm 13 Jun 2002 09:20:16 -0000 1.4 @@ -136,9 +136,30 @@ return qq{<i>$path</i>:\n\n<pre>$content</pre>\n\n}; } +# the <pre> section uses class "pre-section", which allows to use a custom +# look-n-feel via the CSS +sub view_verbatim { + my ($self, $text) = @_; + for ($text) { + s/&/&/g; + s/</</g; + s/>/>/g; + } + + # if the <pre> section is too long ps2pdf fails to generate pdf, + # so split it into 40 lines chunks. + my $result = ''; + while ($text =~ /((?:[^\n]*\n?){1,40})/sg) { + next unless length($1); # skip empty matches + $result .= qq{<pre class="pre-section">$1</pre>\n}; + } + + return $result; +} + + *anchor = \&DocSet::Doc::Common::pod_pom_html_anchor; -*view_verbatim = \&DocSet::Doc::Common::pod_pom_html_view_verbatim; *view_seq_link_transform_path = \&DocSet::Doc::Common::pod_pom_html_view_seq_link_transform_path; #*view_seq_link = \&DocSet::Doc::Common::pod_pom_html_view_seq_link; @@ -197,9 +218,30 @@ it under the current documents path or put the source document in the I</> path. -The following rendering methods: view_verbatim(), anchor() and +view_verbatim() is overriden: renders the +E<lt>preE<gt>...E<lt>/preE<gt> html, but defines a CSS class +C<pre-section> so the look-n-feel can be adjusted. in addition it +splits text into 40 lines chunks. This solves two problems: + +=over + +=item * + +C<html2ps> tries to fit the whole E<lt>preE<gt>...E<lt>/preE<gt> in a +single page ending up using a very small unreadable font when the text +is long. + +=item * + +C<ps2pdf> fails to convert ps to pdf if the former includes +E<lt>preE<gt>...E<lt>/preE<gt>, longer than 40 lines in one chunk. + +=back + +The following rendering methods: anchor() and view_seq_link_transform_path() are defined in the C<DocSet::Doc::Common> class and documented there. + =head1 AUTHORS
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]