You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-dev@perl.apache.org by Per Einar Ellefsen <pe...@skynet.be> on 2002/06/12 22:10:15 UTC
Avoiding the left-border problem
Hi,
I was annoyed by the left border on pre sections being cut when it gets too
long. So I changed the code and stylesheet to wrap it all inside a <div>
tag which sets the border. It works on all browsers I have, and even
removes the annoying white space between the pre sections, except on Opera.
Preview here:
http://users.skynet.be/pereinar/mod-perl/outstanding/success_stories/etoys.com.html
(before, the border would break just after
capacity planning for Christmas 2000 was for three times the traffic
), and that's where I get a newline now on Opera.
Here's the patch, please tell me what you think before I commit:
Allan, will you make sure you incorporate the stylsheet changes into your
current design work, to avoid conflicts when we merge?
Index: lib/DocSet/Doc/Common.pm
===================================================================
RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/Common.pm,v
retrieving revision 1.12
diff -u -r1.12 Common.pm
--- lib/DocSet/Doc/Common.pm 12 Jun 2002 02:53:46 -0000 1.12
+++ lib/DocSet/Doc/Common.pm 12 Jun 2002 20:04:45 -0000
@@ -157,11 +157,12 @@
# if the <pre> section is too long ps2pdf fails to generate pdf,
# so split it into 40 lines chunks.
- my $result = '';
+ my $result = qq{<div class="pre-section">\n};
while ($text =~ /((?:[^\n]*\n?){1,40})/sg) {
next unless length($1); # skip empty matches
- $result .= qq{<pre class="pre-section">$1</pre>\n};
+ $result .= qq{<pre class="pre-section">$1</pre>};
}
+ $result .= qq{</div>\n};
return $result;
}
Index: src/style.css
===================================================================
RCS file: /home/cvs/modperl-docs/src/style.css,v
retrieving revision 1.70
diff -u -r1.70 style.css
--- src/style.css 14 May 2002 05:24:57 -0000 1.70
+++ src/style.css 12 Jun 2002 20:04:45 -0000
@@ -21,13 +21,20 @@
font-size: 1.0em;
}
-.pre-section {
- font-family: courier new, courier, monospace;
- font-size: 1.0em;
+div.pre-section {
border-style: solid;
border-width: 0px 0px 0px 1px;
- white-space: pre;
border-color: #004080; /* same color as quotation */
+}
+
+pre.pre-section {
+ font-family: courier new, courier, monospace;
+ font-size: 1.0em;
+ white-space: pre;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
/* width: 100%; might be needed for konqueror?*/
}
--
Per Einar Ellefsen
per.einar@skynet.be
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Per Einar Ellefsen <pe...@skynet.be>.
At 11:20 13.06.2002, Stas Bekman wrote:
>>Stas, what do you think.. is there a way to make many pre sections only
>>for the PDF version? It would clearly be best.
>
>of course :) fixed.
Ok, great, thank you!
--
Per Einar Ellefsen
per.einar@skynet.be
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Stas Bekman <st...@stason.org>.
Per Einar Ellefsen wrote:
>
> Putting this back on the list...
>
> At 08:44 13.06.2002, allan juul wrote:
>
>> why is there a more than one pre for one single article?
>
>
> Well, this isn't because of Pod, the problem is with the PDF generation:
> too long pre-sections caused them to stay on the same page in the PDF,
> but getting smaller and smaller. This was bad... So Stas changed it this
> way. It clearly annoys me too, but if there's no other way out...
That's one of the reasons, but the real reason for doing that was in
ps2pdf aborting the convertion on huge <pre> sections.
> Stas,
> what do you think.. is there a way to make many pre sections only for
> the PDF version? It would clearly be best.
of course :) fixed.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Per Einar Ellefsen <pe...@skynet.be>.
Putting this back on the list...
At 08:44 13.06.2002, allan juul wrote:
>why is there a more than one pre for one single article?
Well, this isn't because of Pod, the problem is with the PDF generation:
too long pre-sections caused them to stay on the same page in the PDF, but
getting smaller and smaller. This was bad... So Stas changed it this way.
It clearly annoys me too, but if there's no other way out... Stas, what do
you think.. is there a way to make many pre sections only for the PDF
version? It would clearly be best.
>you haven't really solved the problem [though its looks better] by embracing
>that div because we still have the visual line break. so i think the pod-
>source should be rectified
Well, the visual line break wasn't there on IE or Mozilla... On Opera there
seems to be problems handling 0 padding etc... But there might still be
problems on other browsers.
>Quoting Per Einar Ellefsen <pe...@skynet.be>:
>
> > Hi,
> >
> > I was annoyed by the left border on pre sections being cut when it gets too
> >
> > long. So I changed the code and stylesheet to wrap it all inside a <div>
> > tag which sets the border. It works on all browsers I have, and even
> > removes the annoying white space between the pre sections, except on Opera.
> >
> > Preview here:
> > http://users.skynet.be/pereinar/mod-
>perl/outstanding/success_stories/etoys.com.html
> >
> >
> > (before, the border would break just after
> > capacity planning for Christmas 2000 was for three times the traffic
> > ), and that's where I get a newline now on Opera.
> >
> > Here's the patch, please tell me what you think before I commit:
> >
> > Allan, will you make sure you incorporate the stylsheet changes into your
> > current design work, to avoid conflicts when we merge?
> >
> > Index: lib/DocSet/Doc/Common.pm
> > ===================================================================
> > RCS file: /home/cvs/modperl-docs/lib/DocSet/Doc/Common.pm,v
> > retrieving revision 1.12
> > diff -u -r1.12 Common.pm
> > --- lib/DocSet/Doc/Common.pm 12 Jun 2002 02:53:46 -0000 1.12
> > +++ lib/DocSet/Doc/Common.pm 12 Jun 2002 20:04:45 -0000
> > @@ -157,11 +157,12 @@
> >
> > # if the <pre> section is too long ps2pdf fails to generate pdf,
> > # so split it into 40 lines chunks.
> > - my $result = '';
> > + my $result = qq{<div class="pre-section">\n};
> > while ($text =~ /((?:[^\n]*\n?){1,40})/sg) {
> > next unless length($1); # skip empty matches
> > - $result .= qq{<pre class="pre-section">$1</pre>\n};
> > + $result .= qq{<pre class="pre-section">$1</pre>};
> > }
> > + $result .= qq{</div>\n};
> >
> > return $result;
> > }
> > Index: src/style.css
> > ===================================================================
> > RCS file: /home/cvs/modperl-docs/src/style.css,v
> > retrieving revision 1.70
> > diff -u -r1.70 style.css
> > --- src/style.css 14 May 2002 05:24:57 -0000 1.70
> > +++ src/style.css 12 Jun 2002 20:04:45 -0000
> > @@ -21,13 +21,20 @@
> > font-size: 1.0em;
> > }
> >
> > -.pre-section {
> > - font-family: courier new, courier, monospace;
> > - font-size: 1.0em;
> > +div.pre-section {
> > border-style: solid;
> > border-width: 0px 0px 0px 1px;
> > - white-space: pre;
> > border-color: #004080; /* same color as quotation */
> > +}
> > +
> > +pre.pre-section {
> > + font-family: courier new, courier, monospace;
> > + font-size: 1.0em;
> > + white-space: pre;
> > + margin-top: 0px;
> > + margin-bottom: 0px;
> > + padding-top: 0px;
> > + padding-bottom: 0px;
> > /* width: 100%; might be needed for konqueror?*/
> > }
> >
> >
> > --
> > Per Einar Ellefsen
> > per.einar@skynet.be
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
> > For additional commands, e-mail: docs-dev-help@perl.apache.org
> >
> >
>
>
>--
--
Per Einar Ellefsen
per.einar@skynet.be
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Stas Bekman <st...@stason.org>.
Per Einar Ellefsen wrote:
> Hi,
>
> I was annoyed by the left border on pre sections being cut when it gets
> too long. So I changed the code and stylesheet to wrap it all inside a
> <div> tag which sets the border. It works on all browsers I have, and
> even removes the annoying white space between the pre sections, except
> on Opera.
>
> Preview here:
> http://users.skynet.be/pereinar/mod-perl/outstanding/success_stories/etoys.com.html
>
> (before, the border would break just after
> capacity planning for Christmas 2000 was for three times the traffic
> ), and that's where I get a newline now on Opera.
+1 on the code patch, though the stylesheet needs to be tested on other
browsers.
it looks good on mozilla-1.0, NS4 and konqueror on linux.
> Here's the patch, please tell me what you think before I commit:
but don't commmit it, since the DocSet code in cvs is a sync of the
original, so I'll have to commit it there first and later will sync the
two (after we know that the stylesheet is OK).
Thanks!
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Per Einar Ellefsen <pe...@skynet.be>.
At 08:47 13.06.2002, allan juul wrote:
>i have in fact tried several things to overcome this (unhuge) issue with no
>luck (:
Did you try list-* styles with image as the list item?
>Quoting Bill Moseley <mo...@hank.org>:
>
> > At 10:50 AM 06/13/02 +0800, Stas Bekman wrote:
> > >Bill Moseley wrote:
> > >How would you improve it without using tables?
> >
> > Trick question?
> >
> > I'd use table(s). It's such a small amount of content that it won't effect
> > rendering time much.
> >
> > It's also not a huge issue.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
>For additional commands, e-mail: docs-dev-help@perl.apache.org
--
Per Einar Ellefsen
per.einar@skynet.be
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by allan juul <la...@inet.uni2.dk>.
i have in fact tried several things to overcome this (unhuge) issue with no
luck (:
my feelings are we leave it alone for the time untill we think of a un-table-
splattered soloution :)
./allan
Quoting Bill Moseley <mo...@hank.org>:
> At 10:50 AM 06/13/02 +0800, Stas Bekman wrote:
> >Bill Moseley wrote:
> >How would you improve it without using tables?
>
> Trick question?
>
> I'd use table(s). It's such a small amount of content that it won't effect
> rendering time much.
>
> It's also not a huge issue.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Bill Moseley <mo...@hank.org>.
At 10:50 AM 06/13/02 +0800, Stas Bekman wrote:
>Bill Moseley wrote:
>How would you improve it without using tables?
Trick question?
I'd use table(s). It's such a small amount of content that it won't effect
rendering time much.
It's also not a huge issue.
--
Bill Moseley
mailto:moseley@hank.org
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Stas Bekman <st...@stason.org>.
Bill Moseley wrote:
> At 10:10 PM 06/12/02 +0200, Per Einar Ellefsen wrote:
>
>>I was annoyed by the left border on pre sections being cut when it gets too
>>long.
>
>
> Wow, took me a while to even notice it!
>
> I noticed the other day:
>
> http://perl.apache.org/release/outstanding/success_stories/
>
> the first line wraps. It would be nice if the wrap was not back to the
> margin (under the arrow bullet) and instead wrapped just under the text.
It's currently dt/dd:
<dl>
<dt><a href="[%- sec.link -%]"><img src="[%-
doc.dir.abs_doc_root -%]/images/arrow_right.gif" alt="-" align="bottom"
border="0" height="10" width="18">[%- sec.title -%]</a></dt>
[%- IF sec.abstract -%]
<dd>[%- sec.abstract -%]</dd>
[%- END -%]
</dl>
How would you improve it without using tables?
something like this?
<dl>
<dt> image </dt>
<dd> title </dd>
<dd> abstract </dd>
</dl>
?
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Avoiding the left-border problem
Posted by Bill Moseley <mo...@hank.org>.
At 10:10 PM 06/12/02 +0200, Per Einar Ellefsen wrote:
>I was annoyed by the left border on pre sections being cut when it gets too
>long.
Wow, took me a while to even notice it!
I noticed the other day:
http://perl.apache.org/release/outstanding/success_stories/
the first line wraps. It would be nice if the wrap was not back to the
margin (under the arrow bullet) and instead wrapped just under the text.
--
Bill Moseley
mailto:moseley@hank.org
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org