Date: 01 May 2003 23:24:18 +0300 From: Ville =?ISO-8859-1?Q?Skytt=E4?= <scop@FreeBSD.org> To: freebsd-cvsweb@FreeBSD.org Subject: RE: Displaying line numbers Message-ID: <1051820658.4054.85.camel@bobcat.ods.org> In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com> References: <6B1DF6EEBA51D31182F200902740436803B24F59@mail-in.comverse.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2003-05-01 at 20:08, Khachaturov Vassilii wrote: > > In addition to the line numbers, there should be a <a > > name="lXX">XX</a> > > for all lines so that one can point to them using #lXX in URLs. Even > > agreed > > > better if the line referred to in this way would be somehow > > highlighted... > > I doubt this is possible. The #id resolution takes place at the browser > level, > the HTTP query sent to the server doesn't normally include it. Yep. I meant (but failed to note) that I was thinking about doing this in JavaScript, using window.location.hash and dynamically setting the CSS properties for the requested line from the document's onload handler. I think that would work. It might have an impact on the HTML output, possibly requiring a <span> element around each row, or at least extending the <a name> to enclose the whole row in order to be simply able to access one object and set its properties. By the way, is there a function/ perl module for getting the number of lines in a file? `wc -l` of course works... I think that would be needed in order to get the line numbers properly left padded with spaces like in 1 [...] 100 [...] Oh, and I have some doubts whether it'll be possible to have the line numbers with the new Enscript-formatted output... need to check it out. We output it line by line so in case enscript emits one line of HTML per one line of source, it could be trivial. -- \/ille Skyttä scop at FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1051820658.4054.85.camel>