From: Alex T. <al...@tw...> - 2005-12-20 01:14:31
|
Kevin Altis wrote: > I'm sending this message to the general list rather than the > pythoncard-devel list in hopes that some HTML/CSS expert will have a > suggestion for how we can clean up our Python example code in the > documentation so it can be copied and pasted. > > ka > > --- > > It was pointed out to me by Don Taylor that source examples in the > docs can't be copied and pasted and run correctly. He specifically > mentioned this code block in walkthrough2.html which you can see here: > > http://pythoncard.sourceforge.net/walkthrough2.html > > <p class="code"> def > on_incrBtn_mouseClick(self, event):<br /> > startValue = > int(self.components.field1.text)<br /> > endValue = startValue > + 1<br /> > > self.components.field1.text > = str(endValue)</p> > > The code looks fine displayed in the browser, but if someone tries to > copy, paste, and then run it then the messes it up. Since this > isn't an old-style <pre></pre> block you can't simply use spaces in > the code to get the desired effect. The CSS we have defined for the > style is: > The shouldn't mess it up - the browser should copy that as spaces. And indeed that's what it does for me : WinXP copy from : Firefox 1.0.4 and IE 6.0 paste into : Emacs, Notepad and tabcodeEditor -- Alex Tweedly http://www.tweedly.net -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005 |